From d373f77d7d116b1407b1aa9685f4067123f862dc Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 26 Jan 2017 21:24:12 +0100 Subject: mcsh: Fix warning about format string. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -O2 -Wall -pedantic -MT mcs2h.o -MD -MP -MF .deps/mcs2h.Tpo -c -o mcs2h.o mcs2h.c mcs2h.c: In function ‘in2hex’: mcs2h.c:13:16: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=] sscanf(str, "%x", &val); ^ mcs2h.c: In function ‘in4hex’: mcs2h.c:41:16: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=] sscanf(str, "%x", &val); ^ Signed-off-by: Ralf Baechle --- yamdrv/mcs2h.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yamdrv') diff --git a/yamdrv/mcs2h.c b/yamdrv/mcs2h.c index bf9d0e2..7f0d510 100644 --- a/yamdrv/mcs2h.c +++ b/yamdrv/mcs2h.c @@ -5,7 +5,7 @@ int in2hex(char *ptr) { char str[3]; - int val; + unsigned int val; memcpy(str, ptr, 2); str[2] = '\0'; @@ -33,7 +33,7 @@ unsigned char swap(unsigned char c) int in4hex(char *ptr) { char str[5]; - int val; + unsigned int val; memcpy(str, ptr, 4); str[4] = '\0'; -- cgit v1.2.3