util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mcookie: avoid format warning
@ 2014-07-24 13:30 Bernhard Voelker
  2014-07-28  9:11 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Bernhard Voelker @ 2014-07-24 13:30 UTC (permalink / raw)
  To: util-linux; +Cc: Bernhard Voelker

"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@bernhard-voelker.de>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mcookie: avoid format warning
  2014-07-24 13:30 [PATCH] mcookie: avoid format warning Bernhard Voelker
@ 2014-07-28  9:11 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-07-28  9:11 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux

On Thu, Jul 24, 2014 at 03:30:54PM +0200, Bernhard Voelker wrote:
>  misc-utils/mcookie.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-28  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 13:30 [PATCH] mcookie: avoid format warning Bernhard Voelker
2014-07-28  9:11 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).