Monotone-Parent: fb78b987bf29f690a587dc85b6a7c9bb9f262843

Monotone-Revision: b3b6f425c01979bb9afdf39c7034dfd2131f4dd3

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-08-29T02:27:14
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2008-08-29 02:27:14 +00:00
parent 8bcb73ad75
commit 943b77d12f
1 changed files with 3 additions and 12 deletions

View File

@ -1652,26 +1652,17 @@ Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m
===================================================================
--- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (révision 1626)
+++ sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (copie de travail)
@@ -93,7 +93,7 @@
while ((obj = [enumerator nextObject]) != nil) {
NSString *tmp;
- char *buffer;
+ unichar *buffer;
unsigned bufLen, cnt;
BOOL doEnc;
@@ -105,10 +105,10 @@
}
tmp = [obj displayName];
- bufLen = [tmp cStringLength];
+ bufLen = [tmp length];
+ bufLen = [tmp lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
- buffer = calloc(bufLen + 10, sizeof(char));
- [tmp getCString:buffer];
+ buffer = calloc(bufLen, sizeof(unichar));
+ [tmp getCharacters:buffer];
+ buffer = calloc(bufLen, sizeof(char));
+ [tmp getCString: buffer maxLength: bufLen encoding: NSUTF8StringEncoding];
cnt = 0;
doEnc = NO;