comparison lwlib/xlwmenu.c @ 197:acd284d43ca1 r20-3b25

Import from CVS: tag r20-3b25
author cvs
date Mon, 13 Aug 2007 10:00:02 +0200
parents a2f645c6b9f8
children 169c0442b401
comparison
equal deleted inserted replaced
196:58e0786448ca 197:acd284d43ca1
410 char newchars[64]; 410 char newchars[64];
411 char *chars; 411 char *chars;
412 int i, j; 412 int i, j;
413 413
414 #ifdef NEED_MOTIF 414 #ifdef NEED_MOTIF
415 XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars); 415 if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
416 {
417 chars = "";
418 }
416 #else 419 #else
417 chars = string; 420 chars = string;
418 #endif 421 #endif
419 422
420 for (i = j = 0; chars[i]; i++) 423 for (i = j = 0; chars[i] && (j < sizeof (newchars)); i++)
421 if (chars[i]=='%'&&chars[i+1]=='_') 424 if (chars[i]=='%'&&chars[i+1]=='_')
422 i++; 425 i++;
423 else 426 else
424 newchars[j++] = chars[i]; 427 newchars[j++] = chars[i];
425 newchars[j] = '\0'; 428 newchars[j] = '\0';