Minor crash fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@17250 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-07-17 13:26:39 +00:00
parent 163b49ab9e
commit b0deb82085
2 changed files with 8 additions and 7 deletions

View file

@ -1,6 +1,8 @@
2003-07-27 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/gpbs.m: Use protocols
* Source/x11/XGServerWindow.m: Use UTF8String rather than cString
to avoid crashes using non-ascii strings ... is this right?
2003-07-16 Fred Kiefer <FredKiefer@gmx.de>

View file

@ -707,7 +707,7 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
XClassHint classhint;
XTextProperty windowName;
NSUserDefaults *defs;
const char *host_name = [[pInfo hostName] cString];
const char *host_name = [[pInfo hostName] UTF8String];
/*
* Initialize time of last events to be the start of time - not
@ -790,11 +790,10 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
*/
if (rootName == 0)
{
NSString *str;
str = [pInfo processName];
i = [str cStringLength];
rootName = objc_malloc(i+1);
[str getCString: rootName];
const char *str = [[pInfo processName] UTF8String];
rootName = objc_malloc(strlen(str) + 1);
strcpy(rootName, str);
}
classhint.res_name = rootName;
classhint.res_class = "GNUstep";
@ -823,7 +822,7 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
argv = (char**)objc_malloc(argc*sizeof(char*));
for (i = 0; i < argc; i++)
{
argv[i] = (char*)[[args objectAtIndex: i] cString];
argv[i] = (char*)[[args objectAtIndex: i] UTF8String];
}
XSetCommand(dpy, ROOT, argv, argc);
objc_free(argv);