util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: util-linux@vger.kernel.org
Subject: [PATCH 2/2] libfdisk: fix printf format modifier
Date: Wed, 26 Sep 2018 00:37:29 +0200	[thread overview]
Message-ID: <20180925223729.28934-3-sweet_f_a@gmx.de> (raw)
In-Reply-To: <20180925223729.28934-1-sweet_f_a@gmx.de>

From: Ruediger Meier <ruediger.meier@ga-group.nl>

libfdisk/src/script.c: In function ‘fdisk_script_read_context’:
libfdisk/src/script.c:452:33: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
   snprintf(buf, sizeof(buf), "%zu", fdisk_get_grain_size(cxt));
                                 ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 libfdisk/src/script.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
index 24c40f8ce..e7cf1254e 100644
--- a/libfdisk/src/script.c
+++ b/libfdisk/src/script.c
@@ -449,7 +449,7 @@ int fdisk_script_read_context(struct fdisk_script *dp, struct fdisk_context *cxt
 	if (!rc && fdisk_get_grain_size(cxt) != 2048 * 512) {
 		char buf[64];
 
-		snprintf(buf, sizeof(buf), "%zu", fdisk_get_grain_size(cxt));
+		snprintf(buf, sizeof(buf), "%lu", fdisk_get_grain_size(cxt));
 		rc = fdisk_script_set_header(dp, "grain", buf);
 	}
 
-- 
2.13.7

  parent reply	other threads:[~2018-09-26  4:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 22:37 [PATCH 0/2] minor fixes for v2.33 Ruediger Meier
2018-09-25 22:37 ` [PATCH 1/2] libfdisk: fix OSX compiler warning Ruediger Meier
2018-09-25 22:37 ` Ruediger Meier [this message]
2018-10-04  9:58 ` [PATCH 0/2] minor fixes for v2.33 Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180925223729.28934-3-sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).