summaryrefslogtreecommitdiffstats
path: root/bin/pax
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-10-06 03:20:27 +0000
committertjr <tjr@FreeBSD.org>2002-10-06 03:20:27 +0000
commit0eb784108f8156b21532f312b82f257745c8288a (patch)
tree2f6c8a318c4c4c9b5eb52c79314a73ee9582e5ea /bin/pax
parentb07b696b7321da904b128d81acd44d229e1e7acf (diff)
downloadFreeBSD-src-0eb784108f8156b21532f312b82f257745c8288a.zip
FreeBSD-src-0eb784108f8156b21532f312b82f257745c8288a.tar.gz
Fix format string errors relating mainly to the use of %qu to print off_t's.
Instead use %ju and cast the argument. WFORMAT=0 is still required in the Makefile because gcc warns about some strftime() calls (I don't think this behaviour is useful.) Tested on: sparc64, alpha, i386
Diffstat (limited to 'bin/pax')
-rw-r--r--bin/pax/Makefile1
-rw-r--r--bin/pax/ar_io.c15
-rw-r--r--bin/pax/cpio.c5
-rw-r--r--bin/pax/gen_subs.c3
4 files changed, 15 insertions, 9 deletions
diff --git a/bin/pax/Makefile b/bin/pax/Makefile
index 58b4179..270fc1f 100644
--- a/bin/pax/Makefile
+++ b/bin/pax/Makefile
@@ -29,7 +29,6 @@ PROG= pax
SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \
gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \
tables.c tar.c tty_subs.c
-WARNS= 0
WFORMAT=0
#XXX NOTYET
#MAN= pax.1 tar.1 cpio.1
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index 83bb68d..68762b5 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -384,25 +385,29 @@ ar_close(void)
if (frmt == NULL) {
# ifdef NET2_STAT
(void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
+ argv0, rdcnt);
# else
- (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
+ (void)fprintf(listf, "%s: unknown format, %ju bytes skipped.\n",
+ argv0, (uintmax_t)rdcnt);
# endif
- argv0, rdcnt);
(void)fflush(listf);
flcnt = 0;
return;
}
if (strcmp(NM_CPIO, argv0) == 0)
- (void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120);
+ (void)fprintf(listf, "%llu blocks\n",
+ (unsigned long long)((rdcnt ? rdcnt : wrcnt) / 5120));
else if (strcmp(NM_TAR, argv0) != 0)
(void)fprintf(listf,
# ifdef NET2_STAT
"%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
+ argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
# else
- "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
+ "%s: %s vol %d, %ju files, %ju bytes read, %ju bytes written.\n",
+ argv0, frmt->name, arvol-1, (uintmax_t)flcnt,
+ (uintmax_t)rdcnt, (uintmax_t)wrcnt);
# endif
- argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
(void)fflush(listf);
flcnt = 0;
}
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index ed403db..779e5f9 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/stat.h>
#include <string.h>
+#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -223,8 +224,8 @@ rd_ln_nm(ARCHD *arcn)
paxwarn(1, "Cpio link name length is invalid: %lu",
arcn->sb.st_size);
# else
- paxwarn(1, "Cpio link name length is invalid: %qu",
- arcn->sb.st_size);
+ paxwarn(1, "Cpio link name length is invalid: %ju",
+ (uintmax_t)arcn->sb.st_size);
# endif
return(-1);
}
diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
index 86e729f..9a91824 100644
--- a/bin/pax/gen_subs.c
+++ b/bin/pax/gen_subs.c
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/stat.h>
#include <langinfo.h>
+#include <stdint.h>
#include <stdio.h>
#include <utmp.h>
#include <unistd.h>
@@ -138,7 +139,7 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp)
# ifdef NET2_STAT
(void)fprintf(fp, "%9lu ", sbp->st_size);
# else
- (void)fprintf(fp, "%9qu ", sbp->st_size);
+ (void)fprintf(fp, "%9ju ", (uintmax_t)sbp->st_size);
# endif
}
OpenPOWER on IntegriCloud