From 2807105935ef4a1eaac946a86d04cefdb246a659 Mon Sep 17 00:00:00 2001 From: guenther Date: Wed, 8 Jan 2014 05:52:47 +0000 Subject: [PATCH] Replace strtoq(), QUAD_MAX, and %qu with their long long equivalent --- bin/pax/ar_io.c | 10 +++++----- bin/pax/cpio.c | 4 ++-- bin/pax/gen_subs.c | 7 ++++--- bin/pax/options.c | 8 ++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index b8aa571706c..bc789b2cc1b 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar_io.c,v 1.42 2014/01/08 04:58:36 guenther Exp $ */ +/* $OpenBSD: ar_io.c,v 1.43 2014/01/08 05:52:47 guenther Exp $ */ /* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */ /*- @@ -379,7 +379,7 @@ ar_close(void) * could have written anything yet. */ if (frmt == NULL) { - (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n", + (void)fprintf(listf, "%s: unknown format, %llu bytes skipped.\n", argv0, rdcnt); (void)fflush(listf); flcnt = 0; @@ -387,10 +387,10 @@ ar_close(void) } if (strcmp(NM_CPIO, argv0) == 0) - (void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); + (void)fprintf(listf, "%llu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); else if (strcmp(NM_TAR, argv0) != 0) (void)fprintf(listf, - "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n", + "%s: %s vol %d, %lu files, %llu bytes read, %llu bytes written.\n", argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt); (void)fflush(listf); flcnt = 0; @@ -659,7 +659,7 @@ ar_write(char *buf, int bsz) /* * Better tell the user the bad news... * if this is a block aligned archive format, we may have a bad archive - * if the format wants the header to start at a BLKMULT boundary.. While + * if the format wants the header to start at a BLKMULT boundary. While * we can deal with the mis-aligned data, it violates spec and other * archive readers will likely fail. if the format is not block * aligned, the user may be lucky (and the archive is ok). diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index bdc0900dde2..ed20191d6fe 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpio.c,v 1.23 2014/01/08 04:58:36 guenther Exp $ */ +/* $OpenBSD: cpio.c,v 1.24 2014/01/08 05:52:47 guenther Exp $ */ /* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */ /*- @@ -211,7 +211,7 @@ rd_ln_nm(ARCHD *arcn) */ if ((arcn->sb.st_size == 0) || (arcn->sb.st_size >= sizeof(arcn->ln_name))) { - paxwarn(1, "Cpio link name length is invalid: %qu", + paxwarn(1, "Cpio link name length is invalid: %llu", arcn->sb.st_size); return(-1); } diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index d8aeebc6338..1d0540af675 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gen_subs.c,v 1.23 2014/01/08 04:58:36 guenther Exp $ */ +/* $OpenBSD: gen_subs.c,v 1.24 2014/01/08 05:52:47 guenther Exp $ */ /* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */ /*- @@ -121,10 +121,11 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp) * print device id's for devices, or sizes for other nodes */ if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK)) - (void)fprintf(fp, "%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev), + (void)fprintf(fp, "%4lu,%4lu ", + (unsigned long)MAJOR(sbp->st_rdev), (unsigned long)MINOR(sbp->st_rdev)); else { - (void)fprintf(fp, "%9qu ", sbp->st_size); + (void)fprintf(fp, "%9llu ", sbp->st_size); } /* diff --git a/bin/pax/options.c b/bin/pax/options.c index b6130119267..840fafb892a 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.78 2014/01/08 04:58:36 guenther Exp $ */ +/* $OpenBSD: options.c,v 1.79 2014/01/08 05:52:47 guenther Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -1457,8 +1457,8 @@ str_offt(char *val) char *expr; off_t num, t; - num = strtoq(val, &expr, 0); - if ((num == QUAD_MAX) || (num <= 0) || (expr == val)) + num = strtoll(val, &expr, 0); + if ((num == LLONG_MAX) || (num <= 0) || (expr == val)) return(0); switch (*expr) { @@ -1530,7 +1530,7 @@ get_line(FILE *f) temp[len-1] = 0; return(temp); } - + /* * no_op() * for those option functions where the archive format has nothing to do. -- 2.20.1