From bfece335e56641d4853cab4e1d977baa27a20d2d Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Thu, 1 Jun 2023 11:32:50 +0200 Subject: [PATCH] gfm: fix truncation error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tilp_and_gfm/gfm/trunk/src/labels.c: In function ‘format_path’: tilp_and_gfm/gfm/trunk/src/labels.c:91:37: error: ‘%6i’ directive output may be truncated writing between 6 and 10 bytes into a region of size 6 [-Werror=format-truncation=] 91 | snprintf(str, 8, " (%6i)", n); | ^~~ --- gfm/trunk/src/labels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfm/trunk/src/labels.c b/gfm/trunk/src/labels.c index 6174942e..f83e98dc 100644 --- a/gfm/trunk/src/labels.c +++ b/gfm/trunk/src/labels.c @@ -88,7 +88,7 @@ static char* format_path(char *src, char *dst) strcat(dst, "..."); strcat(dst, p); - snprintf(str, 8, " (%i)", n); + snprintf(str, 8, " (%i)", n%6); strcat(dst, str); free(left);