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

Fix compiler warning from menu.c

The patch fixes the compiler warning below

menu.c: In function 'restoreMenuRecurs':
menu.c:2450:47: warning: '%s' directive output may be truncated writing up to 510 bytes into a region of size between 509 and 1019 [-Wformat-truncation=]
 2450 |         snprintf(buffer, sizeof(buffer), "%s\\%s", path, menu->frame->title);
      |                                               ^~

The code is taking care of checking properly the string passed to the buffer,
so there is no issue, the change is just to make the compiler happy.
This commit is contained in:
David Maciejak
2023-02-24 19:21:31 +08:00
committed by Carlos R. Mafra
parent 62405fbb75
commit 492b22d975

View File

@@ -2440,7 +2440,7 @@ static int restoreMenu(WScreen *scr, WMPropList *menu)
static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path) static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path)
{ {
WMPropList *key, *entry; WMPropList *key, *entry;
char buffer[512]; char buffer[1024];
int i, x, y, res; int i, x, y, res;
Bool lowered; Bool lowered;