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 authored and Carlos R. Mafra committed 2023-02-24 12:19:38 +00:00
1 parent 62405fbb75
commit 492b22d975
1 file changed
+1 -1
+1 -1
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;