From f3424f4c7c7e1aba33d0a117ea90dd5412530f45 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 3 Apr 2022 16:08:14 -0700 Subject: Fix -Wformat-truncation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit planemask.c: In function ‘create_planemask_choice’: planemask.c:109:43: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Wformat-truncation=] snprintf(name, sizeof name, "planemask%d",i); ^~ planemask.c:109:33: note: directive argument in the range [0, 2147483647] snprintf(name, sizeof name, "planemask%d",i); ^~~~~~~~~~~~~ planemask.c:109:5: note: ‘snprintf’ output between 11 and 20 bytes into a destination of size 12 snprintf(name, sizeof name, "planemask%d",i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith --- planemask.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planemask.c b/planemask.c index 535d6d5..7548e26 100644 --- a/planemask.c +++ b/planemask.c @@ -67,7 +67,7 @@ create_planemask_choice(Widget w) int i, num_planes; char buf[40]; - char name[12]; + char name[20]; num_planes = PlanesOfScreen(X.scr); -- cgit v1.2.3