mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 21:38:00 +01:00
Fix possible missing NUL at end of string
There are were a few uses of 'strncpy' that could lead to a missing NUL, resulting in possible garbage being displayed. As suggested by Tamas, use 'wstrlcpy' instead
This commit is contained in:
committed by
Carlos R. Mafra
parent
e499f31a4e
commit
e01d14abe4
@@ -749,7 +749,7 @@ void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
|
||||
i = scr->workspace_count - (menu->entry_no - 2);
|
||||
ws = menu->entry_no - 2;
|
||||
while (i > 0) {
|
||||
strncpy(title, scr->workspaces[ws]->name, MAX_WORKSPACENAME_WIDTH);
|
||||
wstrlcpy(title, scr->workspaces[ws]->name, MAX_WORKSPACENAME_WIDTH);
|
||||
|
||||
entry = wMenuAddCallback(menu, title, switchWSCommand, (void *)ws);
|
||||
entry->flags.indicator = 1;
|
||||
|
||||
Reference in New Issue
Block a user