Monotone-Parent: 1b230d2b3187795587acf307f4f13e37ed612a08

Monotone-Revision: 2fba878ec8713c26f41ffeb5cf08c75601a7c6b0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-07-27T21:51:00
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-07-27 21:51:00 +00:00
parent 301ce11f3a
commit 9426768dcd
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2011-07-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/NSString+MAPIStore.m (-asUnicodeInMemCtx): return an
empty string when length == 0, otherwise the resulting pointer
will be NULL.
* OpenChange/plreader.m: new test tool to dump property lists
independently from their serialization format.

View File

@ -33,8 +33,13 @@
char *unicode;
NSData *encoded;
encoded = [self dataUsingEncoding: NSUTF8StringEncoding];
unicode = talloc_strndup (memCtx, [encoded bytes], [encoded length]);
if ([self length] > 0)
{
encoded = [self dataUsingEncoding: NSUTF8StringEncoding];
unicode = talloc_strndup (memCtx, [encoded bytes], [encoded length]);
}
else
unicode = talloc_memdup (memCtx, "", 1);
return unicode;
}