1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtwm: Fix window menus caused by using destination as param to snprintf

This commit is contained in:
Peter Howkins 2018-04-14 00:32:03 +01:00
parent 9b4b82c1f0
commit b410e644c0

View file

@ -202,6 +202,7 @@ void InitBuiltinSystemMenu(void)
#endif /* WSM */ #endif /* WSM */
char *CloString = NULL; char *CloString = NULL;
char dsm[2048]; char dsm[2048];
char dsmtemp[sizeof(dsm)];
Boolean gotItAll; Boolean gotItAll;
gotItAll = True; gotItAll = True;
if(gotItAll) if(gotItAll)
@ -404,11 +405,13 @@ void InitBuiltinSystemMenu(void)
#ifdef WSM #ifdef WSM
if (DtwmBehavior) if (DtwmBehavior)
{ {
snprintf(dsm, sizeof(dsm), "%s%s\n%s\n%s\n no-label f.separator\n", snprintf(dsmtemp, sizeof(dsmtemp), "%s%s\n%s\n%s\n no-label f.separator\n",
dsm, OcpString, OcaString, RemString); dsm, OcpString, OcaString, RemString);
strcpy(dsm, dsmtemp);
} }
#endif /* WSM */ #endif /* WSM */
snprintf(dsm, sizeof(dsm), "%s%s\n}", dsm, CloString); snprintf(dsmtemp, sizeof(dsmtemp), "%s%s\n}", dsm, CloString);
strcpy(dsm, dsmtemp);
if ((builtinSystemMenu = if ((builtinSystemMenu =
(char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL) (char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL)