1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-26 00:12:31 +01:00

fixed a buffer overflow

This commit is contained in:
dan
2002-04-11 20:38:05 +00:00
parent 750917986e
commit ee5b28b0af
2 changed files with 3 additions and 2 deletions

View File

@@ -239,12 +239,12 @@ updateWorkspaceMenu(WMenu *menu)
if (i < menu->entry_no) {
if (strcmp(menu->entries[i]->text,scr->workspaces[i]->name)!=0) {
wfree(menu->entries[i]->text);
strcpy(title, scr->workspaces[i]->name);
strncpy(title, scr->workspaces[i]->name, MAX_WORKSPACENAME_WIDTH);
menu->entries[i]->text = wstrdup(title);
menu->flags.realized = 0;
}
} else {
strcpy(title, scr->workspaces[i]->name);
strncpy(title, scr->workspaces[i]->name, MAX_WORKSPACENAME_WIDTH);
wMenuAddCallback(menu, title, switchWSCommand, NULL);