summaryrefslogtreecommitdiffstats
path: root/misc-utils/wipefs.c
diff options
context:
space:
mode:
authorRuediger Meier2016-02-22 11:58:05 +0100
committerRuediger Meier2016-03-07 23:16:04 +0100
commitfdbd7bb94051bce49a40b0e055bfa21755de3b1c (patch)
treeb4525048d811b8a7bf1d6574922995fa25fb8a9f /misc-utils/wipefs.c
parentwipefs, sfdisk: include libgen.h for basename(3p) (diff)
downloadkernel-qcow2-util-linux-fdbd7bb94051bce49a40b0e055bfa21755de3b1c.tar.gz
kernel-qcow2-util-linux-fdbd7bb94051bce49a40b0e055bfa21755de3b1c.tar.xz
kernel-qcow2-util-linux-fdbd7bb94051bce49a40b0e055bfa21755de3b1c.zip
misc: again fixing many printf format strings
This is again a huge patch regarding printf format strings to fix compiler warnings seen on clang/OSX. I'm trying to follow these rules strictly: #type #format #cast uintmax_t %ju - intmax_t %jd - uint64_t PRIu64 - int64_t PRId64 - size_t %zu - ssize_t %zd - ino_t %ju (uintmax_t) off_t %jd (intmax_t) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r--misc-utils/wipefs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index abcf5ebe3..9cd29ad98 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -84,7 +84,7 @@ print_pretty(struct wipe_desc *wp, int line)
printf("----------------------------------------------------------------\n");
}
- printf("0x%-17jx %s [%s]", wp->offset, wp->type, _(wp->usage));
+ printf("0x%-17jx %s [%s]", (intmax_t)wp->offset, wp->type, _(wp->usage));
if (wp->label && *wp->label)
printf("\n%27s %s", "LABEL:", wp->label);
@@ -101,7 +101,7 @@ print_parsable(struct wipe_desc *wp, int line)
if (!line)
printf("# offset,uuid,label,type\n");
- printf("0x%jx,", wp->offset);
+ printf("0x%jx,", (intmax_t)wp->offset);
if (wp->uuid) {
blkid_encode_string(wp->uuid, enc, sizeof(enc));
@@ -311,7 +311,7 @@ static void do_wipe_real(blkid_probe pr, const char *devname,
if (blkid_do_wipe(pr, (flags & WP_FL_NOACT) != 0))
warn(_("%s: failed to erase %s magic string at offset 0x%08jx"),
- devname, w->type, w->offset);
+ devname, w->type, (intmax_t)w->offset);
if (flags & WP_FL_QUIET)
return;
@@ -319,7 +319,7 @@ static void do_wipe_real(blkid_probe pr, const char *devname,
printf(P_("%s: %zd byte was erased at offset 0x%08jx (%s): ",
"%s: %zd bytes were erased at offset 0x%08jx (%s): ",
w->len),
- devname, w->len, w->offset, w->type);
+ devname, w->len, (intmax_t)w->offset, w->type);
for (i = 0; i < w->len; i++) {
printf("%02x", w->magic[i]);
@@ -334,7 +334,7 @@ static void do_backup(struct wipe_desc *wp, const char *base)
char *fname = NULL;
int fd;
- xasprintf(&fname, "%s0x%08jx.bak", base, wp->offset);
+ xasprintf(&fname, "%s0x%08jx.bak", base, (intmax_t)wp->offset);
fd = open(fname, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
if (fd < 0)
@@ -428,7 +428,7 @@ do_wipe(struct wipe_desc *wp, const char *devname, int flags)
for (w = wp0; w != NULL; w = w->next) {
if (!w->on_disk && !(flags & WP_FL_QUIET))
- warnx(_("%s: offset 0x%jx not found"), devname, w->offset);
+ warnx(_("%s: offset 0x%jx not found"), devname, (uintmax_t)w->offset);
}
if (need_force)