From 492b22d975a3e60b7cede2445fcea2ddc55c606c Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Fri, 24 Feb 2023 19:21:31 +0800 Subject: [PATCH] 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. --- src/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu.c b/src/menu.c index 4116cbf8..2b9f3261 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2440,7 +2440,7 @@ static int restoreMenu(WScreen *scr, WMPropList *menu) static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path) { WMPropList *key, *entry; - char buffer[512]; + char buffer[1024]; int i, x, y, res; Bool lowered;