Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct binary plist writes for non-CFData types (thanks to

Stuart Crook.)


git-svn-id: https://opencflite.svn.sourceforge.net/svnroot/opencflite@116 949b7c4e-b822-e185-8c53-f993a654f32e
  • Loading branch information...
commit 28f660fd7ba2e2a1addf1f30b42aba42a5245021 1 parent ac148ea
bfulgham authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 CFBinaryPList.c
View
7 CFBinaryPList.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2008-2009 Brent Fulgham <bfulgham@gmail.org>. All rights reserved.
+ * Copyright (c) 2009 Stuart Crook <stuart@echus.demon.co.uk>. All rights reserved.
*
* This source code is a modified version of the CoreFoundation sources released by Apple Inc. under
* the terms of the APSL version 2.0 (see below).
@@ -46,6 +47,7 @@
#include <CoreFoundation/CFPropertyList.h>
#include <CoreFoundation/CFByteOrder.h>
#include <CoreFoundation/CFRuntime.h>
+#include <CoreFoundation/CFStream.h>
#include <stdio.h>
#include <stdint.h>
#include <limits.h>
@@ -178,7 +180,12 @@ static void writeBytes(__CFBinaryPlistWriteBuffer *buf, const UInt8 *bytes, CFIn
CFDataAppendBytes((CFMutableDataRef)buf->stream, bytes, length);
buf->written += length;
} else {
+ /* SystemConfiguration relies on being able to serialize a plist to a write stream.
+ * There seems no reason why this isn't supported. The old code read:
CFAssert(false, __kCFLogAssertion, "Streams are not supported on this platform");
+ */
+ CFIndex lengthWritten = CFWriteStreamWrite((CFWriteStreamRef)buf->stream, bytes, length);
+ buf->written += lengthWritten;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.