diff lwlib/xlwmenu.c @ 290:c9fe270a4101 r21-0b43

Import from CVS: tag r21-0b43
author cvs
date Mon, 13 Aug 2007 10:36:47 +0200
parents c5d627a313b1
children afd57c14dfc8
line wrap: on
line diff
--- a/lwlib/xlwmenu.c	Mon Aug 13 10:35:55 2007 +0200
+++ b/lwlib/xlwmenu.c	Mon Aug 13 10:36:47 2007 +0200
@@ -417,7 +417,8 @@
   int drop;
 # endif
 #endif
-  char newchars[64];
+  char* newchars;
+  int charslength;
   char *chars;
   int i, j;
 
@@ -429,8 +430,10 @@
 #else
   chars = string;
 #endif
-
-  for (i = j = 0; chars[i] && (j < (int) sizeof (newchars)); i++)
+  charslength = strlen (chars);
+  newchars = (char *) alloca (charslength + 1);
+
+  for (i = j = 0; chars[i] && (j < charslength); i++)
     if (chars[i]=='%'&&chars[i+1]=='_')
 	    i++;
     else