[PATCH] mcookie: avoid format warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]"
issued the following warning:

  warning: format ‘%zu’ expects argument of type ‘size_t’, \
  but argument 3 has type ‘int’ [-Wformat=]

* misc-utils/mcookie.c (main): Change format from %zu to %d.
RAND_BYTES is an enum, thus of type int.

Signed-off-by: Bernhard Voelker <mail@xxxxxxxxxxxxxxxxxxx>
---
 misc-utils/mcookie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c
index a46ea0c..c370c2a 100644
--- a/misc-utils/mcookie.c
+++ b/misc-utils/mcookie.c
@@ -182,8 +182,8 @@ int main(int argc, char **argv)
 	random_get_bytes(&buf, RAND_BYTES);
 	MD5Update(&ctl.ctx, buf, RAND_BYTES);
 	if (ctl.verbose)
-		fprintf(stderr, P_("Got %zu byte from %s\n",
-				   "Got %zu bytes from %s\n", RAND_BYTES),
+		fprintf(stderr, P_("Got %d byte from %s\n",
+				   "Got %d bytes from %s\n", RAND_BYTES),
 				RAND_BYTES, random_tell_source());
 
 	MD5Final(digest, &ctl.ctx);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux