src/os/macosx/macos.mm
changeset 7839 feb131e32620
parent 7435 c5d1a7a3235c
child 7965 e651c71175d6
--- a/src/os/macosx/macos.mm	Wed Nov 07 14:33:52 2007 +0000
+++ b/src/os/macosx/macos.mm	Wed Nov 07 21:35:33 2007 +0000
@@ -168,6 +168,6 @@
 	NSArray* languages = [defs objectForKey:@"AppleLanguages"];
 	NSString* preferredLang = [languages objectAtIndex:0];
 	/* preferredLang is either 2 or 5 characters long ("xx" or "xx_YY"). */
-	strncpy(retbuf, [preferredLang cString], 31);
+	[ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ];
 	return retbuf;
 }