1998-06-05 Colin Rafferty * lwlib/xlwmenu.c: Made newchars be as large as it needs to be. --- lwlib/xlwmenu.c~ Tue Mar 31 15:11:14 1998 +++ lwlib/xlwmenu.c Fri Jun 5 08:52:19 1998 @@ -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 + charslength = strlen (chars); + newchars = (char*) malloc (charslength); - for (i = j = 0; chars[i] && (j < (int) sizeof (newchars)); i++) + for (i = j = 0; chars[i] && (j < charslength); i++) if (chars[i]=='%'&&chars[i+1]=='_') i++; else @@ -441,13 +444,16 @@ newstring = XmStringLtoRCreate (newchars, XmFONTLIST_DEFAULT_TAG); XmStringExtent (mw->menu.font_list, newstring, &width, &height); XmStringFree (newstring); + free (newchars); return width; #else # ifdef USE_XFONTSET XmbTextExtents (mw->menu.font_set, newchars, j, &ri, &rl); + free (newchars); return rl.width; # else /* ! USE_XFONTSET */ XTextExtents (mw->menu.font, newchars, j, &drop, &drop, &drop, &xcs); + free (newchars); return xcs.width; # endif /* USE_XFONTSET */ #endif