From fdda1d296194f598f1a4018de49446daf17fc429 Mon Sep 17 00:00:00 2001 From: Johnny Bengtsson Date: Thu, 15 Mar 2018 13:59:43 +0100 Subject: [PATCH] Minor warning correction. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fix resolves the warnings as printed below. ui.c: In function ‘PrintAndLogOptions’: ui.c:40:45: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=] snprintf(format, sizeof(format), "%%%us%%%us", space, counts[j]); ^ ui.c:40:50: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=] snprintf(format, sizeof(format), "%%%us%%%us", space, counts[j]); ^ ui.c:42:54: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=] snprintf(format, sizeof(format), "%%%us%%-%us", space, counts[j]); ^ ui.c:42:60: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=] snprintf(format, sizeof(format), "%%%us%%-%us", space, counts[j]); --- client/ui.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ui.c b/client/ui.c index 60ccf4ac9..68fedeeca 100644 --- a/client/ui.c +++ b/client/ui.c @@ -37,10 +37,10 @@ void PrintAndLogOptions(char *str[][2], size_t size, size_t space) for(int j = 0; j < 2; j++) { if(j == 0) - snprintf(format, sizeof(format), "%%%us%%%us", space, counts[j]); + snprintf(format, sizeof(format), "%%%zus%%%zus", space, counts[j]); else - snprintf(format, sizeof(format), "%%%us%%-%us", space, counts[j]); - snprintf(buff + strlen(buff), sizeof(buff) - strlen(buff), format, " ", str[i][j]); + snprintf(format, sizeof(format), "%%%zus%%-%zus", space, counts[j]); + snprintf(buff + strlen(buff), sizeof(buff) - strlen(buff), format, " ", str[i][j]); } if(i