diff options
author | 2013-08-22 04:43:40 +0000 | |
---|---|---|
committer | 2013-08-22 04:43:40 +0000 | |
commit | 82ff36301fdb8c25511dd105cf211d26ea7f836e (patch) | |
tree | f17f8c8d35e761468f7997cee38d8a28bf837c8b | |
parent | Split out from kdump.c the ktrstruct.c bits into ktrstruct.c (diff) | |
download | wireguard-openbsd-82ff36301fdb8c25511dd105cf211d26ea7f836e.tar.xz wireguard-openbsd-82ff36301fdb8c25511dd105cf211d26ea7f836e.zip |
Correct format string mismatches turned up by -Wformat=2
suggestions and ok millert@
-rw-r--r-- | bin/csh/time.c | 13 | ||||
-rw-r--r-- | games/adventure/wizard.c | 4 | ||||
-rw-r--r-- | games/fortune/strfile/strfile.c | 4 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 6 | ||||
-rw-r--r-- | libexec/login_token/token.c | 12 | ||||
-rw-r--r-- | usr.bin/last/last.c | 6 | ||||
-rw-r--r-- | usr.bin/lock/lock.c | 10 | ||||
-rw-r--r-- | usr.bin/pr/pr.c | 7 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_cscope.c | 5 | ||||
-rw-r--r-- | usr.bin/vmstat/vmstat.c | 4 | ||||
-rw-r--r-- | usr.bin/w/w.c | 4 | ||||
-rw-r--r-- | usr.bin/who/who.c | 6 | ||||
-rw-r--r-- | usr.sbin/apmd/apmd.c | 6 | ||||
-rw-r--r-- | usr.sbin/httpd/src/main/http_protocol.c | 10 | ||||
-rw-r--r-- | usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c | 4 | ||||
-rw-r--r-- | usr.sbin/kvm_mkdb/nlist.c | 4 | ||||
-rw-r--r-- | usr.sbin/mtree/create.c | 4 | ||||
-rw-r--r-- | usr.sbin/pstat/pstat.c | 4 | ||||
-rw-r--r-- | usr.sbin/quot/quot.c | 12 | ||||
-rw-r--r-- | usr.sbin/rbootd/utils.c | 8 | ||||
-rw-r--r-- | usr.sbin/route6d/route6d.c | 4 | ||||
-rw-r--r-- | usr.sbin/ypserv/makedbm/makedbm.c | 8 | ||||
-rw-r--r-- | usr.sbin/ypserv/mkalias/mkalias.c | 5 |
23 files changed, 81 insertions, 69 deletions
diff --git a/bin/csh/time.c b/bin/csh/time.c index 0550dac75b3..cfa3b4adfaa 100644 --- a/bin/csh/time.c +++ b/bin/csh/time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: time.c,v 1.13 2013/04/16 22:13:30 deraadt Exp $ */ +/* $OpenBSD: time.c,v 1.14 2013/08/22 04:43:40 guenther Exp $ */ /* $NetBSD: time.c,v 1.7 1995/03/21 13:55:25 mycroft Exp $ */ /*- @@ -164,19 +164,20 @@ prusage(struct rusage *r0, struct rusage *r1, struct timeval *e, case 'X': /* (average) shared text size */ (void) fprintf(cshout, "%ld", t == 0 ? 0L : - (r1->ru_ixrss - r0->ru_ixrss) / t); + (long)((r1->ru_ixrss - r0->ru_ixrss) / t)); break; case 'D': /* (average) unshared data size */ (void) fprintf(cshout, "%ld", t == 0 ? 0L : - (r1->ru_idrss + r1->ru_isrss - - (r0->ru_idrss + r0->ru_isrss)) / t); + (long)((r1->ru_idrss + r1->ru_isrss - + (r0->ru_idrss + r0->ru_isrss)) / t)); break; case 'K': /* (average) total data memory used */ (void) fprintf(cshout, "%ld", t == 0 ? 0L : - ((r1->ru_ixrss + r1->ru_isrss + r1->ru_idrss) - - (r0->ru_ixrss + r0->ru_idrss + r0->ru_isrss)) / t); + (long)(((r1->ru_ixrss + r1->ru_isrss + r1->ru_idrss) + - (r0->ru_ixrss + r0->ru_idrss + r0->ru_isrss)) + / t)); break; case 'M': /* max. Resident Set Size */ diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c index b01c9112162..55690443991 100644 --- a/games/adventure/wizard.c +++ b/games/adventure/wizard.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wizard.c,v 1.14 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: wizard.c,v 1.15 2013/08/22 04:43:41 guenther Exp $ */ /* $NetBSD: wizard.c,v 1.3 1995/04/24 12:21:41 cgd Exp $ */ /*- @@ -84,7 +84,7 @@ Start(void) if (delay >= latncy) return (FALSE); printf("This adventure was suspended a mere %d minute%s ago.", - delay, delay == 1 ? "" : "s"); + (int)delay, delay == 1 ? "" : "s"); if (delay <= latncy / 3) { mspeak(2); exit(0); diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index c859053d26e..8c2fd7b8c87 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strfile.c,v 1.17 2009/10/27 23:59:24 deraadt Exp $ */ +/* $OpenBSD: strfile.c,v 1.18 2013/08/22 04:43:41 guenther Exp $ */ /* $NetBSD: strfile.c,v 1.4 1995/04/24 12:23:09 cgd Exp $ */ /*- @@ -207,7 +207,7 @@ main(int ac, char *av[]) if (Tbl.str_numstr == 1) puts("There was 1 string"); else - printf("There were %ld strings\n", Tbl.str_numstr); + printf("There were %u strings\n", Tbl.str_numstr); printf("Longest string: %lu byte%s\n", (unsigned long) Tbl.str_longlen, Tbl.str_longlen == 1 ? "" : "s"); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index f5890be152b..fc523178ee7 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.197 2013/07/26 18:13:02 guenther Exp $ */ +/* $OpenBSD: ftpd.c,v 1.198 2013/08/22 04:43:40 guenther Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -2812,8 +2812,8 @@ logxfer(char *name, off_t size, time_t start) strvis(vpw, guest? guestpw : pw->pw_name, VIS_SAFE|VIS_NOSLASH); len = snprintf(buf, sizeof(buf), - "%.24s %d %s %qd %s %c %s %c %c %s ftp %d %s %s\n", - ctime(&now), now - start + (now == start), + "%.24s %lld %s %qd %s %c %s %c %c %s ftp %d %s %s\n", + ctime(&now), (long long)(now - start + (now == start)), vremotehost, (long long)size, vpath, ((type == TYPE_A) ? 'a' : 'b'), "*" /* none yet */, 'o', ((guest) ? 'a' : 'r'), diff --git a/libexec/login_token/token.c b/libexec/login_token/token.c index 3993dce840c..83ed46986d7 100644 --- a/libexec/login_token/token.c +++ b/libexec/login_token/token.c @@ -1,4 +1,4 @@ -/* $OpenBSD: token.c,v 1.15 2013/05/07 12:17:20 tedu Exp $ */ +/* $OpenBSD: token.c,v 1.16 2013/08/22 04:43:40 guenther Exp $ */ /*- * Copyright (c) 1995 Migration Associates Corp. All Rights Reserved @@ -176,7 +176,7 @@ tokenverify(char *username, char *challenge, char *response) (void)strtok(challenge, "\""); state = strtok(NULL, "\""); tmp.ul[0] = strtoul(state, NULL, 10); - snprintf(tokennumber.ct, sizeof(tokennumber.ct), "%8.8lu",tmp.ul[0]); + snprintf(tokennumber.ct, sizeof(tokennumber.ct), "%8.8u",tmp.ul[0]); /* * Retrieve the db record for the user. Nuke it as soon as @@ -212,7 +212,7 @@ tokenverify(char *username, char *challenge, char *response) */ HTONL(cipher_text.ul[0]); - snprintf(cmp_text.ct, sizeof(cmp_text.ct), "%8.8lx", cipher_text.ul[0]); + snprintf(cmp_text.ct, sizeof(cmp_text.ct), "%8.8x", cipher_text.ul[0]); if (tokenrec.mode & TOKEN_PHONEMODE) { /* @@ -318,7 +318,7 @@ tokenuserinit(int flags, char *username, unsigned char *usecret, unsigned mode) DES_ecb_encrypt(&nulls.cb, &checksum.cb, &key_schedule, DES_ENCRYPT); memset(&key_schedule, 0, sizeof(key_schedule)); HTONL(checksum.ul[0]); - snprintf(checktxt.ct, sizeof(checktxt.ct), "%8.8lx", checksum.ul[0]); + snprintf(checktxt.ct, sizeof(checktxt.ct), "%8.8x", checksum.ul[0]); printf("Hex Checksum: \"%s\"", checktxt.ct); h2d(checktxt.ct); @@ -370,8 +370,8 @@ cb2h(TOKEN_CBlock cb, char* hp) { char scratch[17]; - snprintf(scratch, 9, "%8.8lx", cb.ul[0]); - snprintf(scratch+8, 9, "%8.8lx", cb.ul[1]); + snprintf(scratch, 9, "%8.8x", cb.ul[0]); + snprintf(scratch+8, 9, "%8.8x", cb.ul[1]); memcpy(hp, scratch, 16); } diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index d404dad6f27..33ec175a097 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -1,4 +1,4 @@ -/* $OpenBSD: last.c,v 1.38 2013/02/18 10:40:12 fgsch Exp $ */ +/* $OpenBSD: last.c,v 1.39 2013/08/22 04:43:40 guenther Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* @@ -377,8 +377,8 @@ wtmp(void) timesize, timesize, asctime(gmtime(&delta))+11); else - printf(" (%ld+%*.*s)\n", - delta / SECSPERDAY, + printf(" (%lld+%*.*s)\n", + (long long)delta / SECSPERDAY, timesize, timesize, asctime(gmtime(&delta))+11); } diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c index 21c76cd05c9..12d89e9a756 100644 --- a/usr.bin/lock/lock.c +++ b/usr.bin/lock/lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock.c,v 1.26 2010/06/13 15:26:06 tobias Exp $ */ +/* $OpenBSD: lock.c,v 1.27 2013/08/22 04:43:40 guenther Exp $ */ /* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */ /* @@ -224,14 +224,14 @@ void hi(int signo) { char buf[1024], buf2[1024]; - time_t now; + time_t left; if (no_timeout) buf2[0] = '\0'; else { - now = time(NULL); - (void)snprintf(buf2, sizeof buf2, " timeout in %d:%d minutes", - (nexttime - now) / 60, (nexttime - now) % 60); + left = nexttime - time(NULL); + (void)snprintf(buf2, sizeof buf2, " timeout in %lld:%d minutes", + (long long)(left / 60), (int)(left % 60)); } (void)snprintf(buf, sizeof buf, "%s: type in the unlock key.%s\n", __progname, buf2); diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 49cc573d3a1..5ebfcd34ecc 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pr.c,v 1.31 2013/04/18 02:28:48 deraadt Exp $ */ +/* $OpenBSD: pr.c,v 1.32 2013/08/22 04:43:40 guenther Exp $ */ /*- * Copyright (c) 1991 Keith Muller. @@ -844,6 +844,7 @@ flsh_errs(void) } } +static void ferrout(char *fmt, ...) __attribute__((format (printf, 1, 2))); static void ferrout(char *fmt, ...) { @@ -861,8 +862,10 @@ ferrout(char *fmt, ...) sigprocmask(SIG_BLOCK, &block, &oblock); if (vasprintf(&p, fmt, ap) == -1 || (f = malloc(sizeof(*f))) == NULL) { + va_end(ap); + va_start(ap, fmt); flsh_errs(); - fprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); fputs("pr: memory allocation failed\n", stderr); exit(1); } diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c index 78819f3dda4..060bee19f6f 100644 --- a/usr.bin/vi/ex/ex_cscope.c +++ b/usr.bin/vi/ex/ex_cscope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cscope.c,v 1.16 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_cscope.c,v 1.17 2013/08/22 04:43:40 guenther Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -495,7 +495,8 @@ cscope_find(sp, cmdp, pattern) * search cscope command character and a leading space * there.) */ - (void)fprintf(csc->to_fp, "%d%s\n", search, tqp->tag + 2); + (void)fprintf(csc->to_fp, "%lu%s\n", (unsigned long)search, + tqp->tag + 2); (void)fflush(csc->to_fp); /* Read the output. */ diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 34bd31a071c..cbfd655a71f 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1,5 +1,5 @@ /* $NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $ */ -/* $OpenBSD: vmstat.c,v 1.122 2013/07/18 08:42:50 bluhm Exp $ */ +/* $OpenBSD: vmstat.c,v 1.123 2013/08/22 04:43:40 guenther Exp $ */ /* * Copyright (c) 1980, 1986, 1991, 1993 @@ -368,7 +368,7 @@ dovmstat(u_int interval, int reps) } (void)printf(" %u %u %u ", total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); -#define rate(x) ((((unsigned)x) + halfuptime) / uptime) /* round */ +#define rate(x) ((unsigned)((((unsigned)x) + halfuptime) / uptime)) /* round */ #define pgtok(a) ((a) * ((unsigned int)uvmexp.pagesize >> 10)) (void)printf("%6u %7u ", pgtok(total.t_avm), pgtok(total.t_free)); diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index cd649dcf6af..9bcd411298f 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w.c,v 1.51 2012/06/24 06:34:34 guenther Exp $ */ +/* $OpenBSD: w.c,v 1.52 2013/08/22 04:43:41 guenther Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -414,7 +414,7 @@ pr_header(time_t *nowp, int nusers) mins, mins != 1 ? "s" : ""); } } else - printf(" %d secs,", uptime); + printf(" %d secs,", (int)uptime); } /* Print number of users logged in to system */ diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c index 88f70943a24..3506affc337 100644 --- a/usr.bin/who/who.c +++ b/usr.bin/who/who.c @@ -1,4 +1,4 @@ -/* $OpenBSD: who.c,v 1.19 2010/11/15 10:57:49 otto Exp $ */ +/* $OpenBSD: who.c,v 1.20 2013/08/22 04:43:41 guenther Exp $ */ /* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */ /* @@ -245,8 +245,8 @@ output(struct utmp *up) (void)printf(" . "); else if (idle < (24 * 60 * 60)) (void)printf("%02d:%02d ", - (idle / (60 * 60)), - (idle % (60 * 60)) / 60); + ((int)idle / (60 * 60)), + ((int)idle % (60 * 60)) / 60); else (void)printf(" old "); } diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index c09370d9d54..e225c17e896 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmd.c,v 1.61 2013/05/19 18:37:40 tedu Exp $ */ +/* $OpenBSD: apmd.c,v 1.62 2013/08/22 04:43:41 guenther Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -666,8 +666,8 @@ main(int argc, char *argv[]) if (ev->ident == ctl_fd) { suspends = standbys = resumes = 0; syslog(LOG_DEBUG, "apmevent %04x index %d", - APM_EVENT_TYPE(ev->data), - APM_EVENT_INDEX(ev->data)); + (int)APM_EVENT_TYPE(ev->data), + (int)APM_EVENT_INDEX(ev->data)); switch (APM_EVENT_TYPE(ev->data)) { case APM_SUSPEND_REQ: diff --git a/usr.sbin/httpd/src/main/http_protocol.c b/usr.sbin/httpd/src/main/http_protocol.c index e26c60ab883..f2a91318257 100644 --- a/usr.sbin/httpd/src/main/http_protocol.c +++ b/usr.sbin/httpd/src/main/http_protocol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http_protocol.c,v 1.38 2013/08/08 03:16:13 guenther Exp $ */ +/* $OpenBSD: http_protocol.c,v 1.39 2013/08/22 04:43:41 guenther Exp $ */ /* ==================================================================== * The Apache Software License, Version 1.1 @@ -1349,14 +1349,14 @@ API_EXPORT(void) ap_note_digest_auth_failure(request_rec *r) */ char * nonce_prefix = ap_md5(r->pool, (unsigned char *) - ap_psprintf(r->pool, "%s%lu", - ap_auth_nonce(r), r->request_time)); + ap_psprintf(r->pool, "%s%lld", + ap_auth_nonce(r), (long long)r->request_time)); ap_table_setn(r->err_headers_out, r->proxyreq == STD_PROXY ? "Proxy-Authenticate" : "WWW-Authenticate", - ap_psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%s%lu\"", - ap_auth_name(r), nonce_prefix, r->request_time)); + ap_psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%s%lld\"", + ap_auth_name(r), nonce_prefix, (long long)r->request_time)); } API_EXPORT(int) ap_get_basic_auth_pw(request_rec *r, const char **pw) diff --git a/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c b/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c index 0115ec15208..3aaef8eb29d 100644 --- a/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c +++ b/usr.sbin/httpd/src/modules/experimental/mod_auth_digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mod_auth_digest.c,v 1.22 2008/05/25 11:46:27 mbalmer Exp $ */ +/* $OpenBSD: mod_auth_digest.c,v 1.23 2013/08/22 04:43:41 guenther Exp $ */ /* ==================================================================== * The Apache Software License, Version 1.1 @@ -884,7 +884,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp, if (strlen(resp->nonce) != NONCE_LEN) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, - "Digest: invalid nonce %s received - length is not %d", + "Digest: invalid nonce %s received - length is not %zu", resp->nonce, NONCE_LEN); note_digest_auth_failure(r, conf, resp, 1); return AUTH_REQUIRED; diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c index 267a2bda9b0..8edd6f687b7 100644 --- a/usr.sbin/kvm_mkdb/nlist.c +++ b/usr.sbin/kvm_mkdb/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.41 2013/01/29 22:39:06 miod Exp $ */ +/* $OpenBSD: nlist.c,v 1.42 2013/08/22 04:43:41 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -318,7 +318,7 @@ __elf_knlist(int fd, DB *db, int ksyms) sh = (Elf_Shdr *)calloc(sizeof(Elf_Shdr), eh.e_shnum); if (sh == NULL) - errx(1, "cannot allocate %d bytes for symbol header", + errx(1, "cannot allocate %zu bytes for symbol header", sizeof(Elf_Shdr) * eh.e_shnum); if (fseek (fp, eh.e_shoff, SEEK_SET) < 0) { diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index 3eb80cb98c1..777a9bff344 100644 --- a/usr.sbin/mtree/create.c +++ b/usr.sbin/mtree/create.c @@ -1,5 +1,5 @@ /* $NetBSD: create.c,v 1.11 1996/09/05 09:24:19 mycroft Exp $ */ -/* $OpenBSD: create.c,v 1.28 2013/04/16 23:42:44 deraadt Exp $ */ +/* $OpenBSD: create.c,v 1.29 2013/08/22 04:43:41 guenther Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -195,7 +195,7 @@ statf(int indent, FTSENT *p) crc(fd, &val, &len)) error("%s: %s", p->fts_accpath, strerror(errno)); (void)close(fd); - output(indent, &offset, "cksum=%lu", val); + output(indent, &offset, "cksum=%u", val); } if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { char *md5digest, buf[MD5_DIGEST_STRING_LENGTH]; diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 8ae34e9e90b..ccfb8652d51 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pstat.c,v 1.85 2013/06/05 01:26:00 guenther Exp $ */ +/* $OpenBSD: pstat.c,v 1.86 2013/08/22 04:43:41 guenther Exp $ */ /* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */ /*- @@ -607,7 +607,7 @@ nfs_print(struct vnode *vp) *flags++ = '-'; *flags = '\0'; - (void)printf(" %6ld %5s", np->n_vattr.va_fileid, flagbuf); + (void)printf(" %6lld %5s", (long long)np->n_vattr.va_fileid, flagbuf); type = np->n_vattr.va_mode & S_IFMT; if (S_ISCHR(np->n_vattr.va_mode) || S_ISBLK(np->n_vattr.va_mode)) if (usenumflag || diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index 04c6d3a291d..3c096964b8f 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quot.c,v 1.22 2013/06/11 16:42:19 deraadt Exp $ */ +/* $OpenBSD: quot.c,v 1.23 2013/08/22 04:43:41 guenther Exp $ */ /* * Copyright (C) 1991, 1994 Wolfgang Solfrank. @@ -406,8 +406,9 @@ dofsizes(int fd, struct fs *super, char *name) for (fp = fsizes; fp; fp = fp->fsz_next) { for (i = 0; i < FSZCNT; i++) { if (fp->fsz_count[i]) - printf("%d\t%d\t%lld\n", - fp->fsz_first + i, fp->fsz_count[i], + printf("%lld\t%llu\t%lld\n", + (long long)fp->fsz_first + i, + (unsigned long long)fp->fsz_count[i], SIZE(sz += fp->fsz_sz[i])); } } @@ -456,7 +457,8 @@ static void donames(int fd, struct fs *super, char *name) { int c; - ino_t inode, inode1; + unsigned long long inode; + ino_t inode1; ino_t maxino; union dinode *dp; @@ -466,7 +468,7 @@ donames(int fd, struct fs *super, char *name) while ((c = getchar()) != EOF && c != '\n'); ungetc(c, stdin); inode1 = -1; - while (scanf("%d", &inode) == 1) { + while (scanf("%llu", &inode) == 1) { if (inode < 0 || inode > maxino) { #ifndef COMPAT fprintf(stderr, "invalid inode %llu\n", diff --git a/usr.sbin/rbootd/utils.c b/usr.sbin/rbootd/utils.c index 16a6aceb5db..3ad5792d51a 100644 --- a/usr.sbin/rbootd/utils.c +++ b/usr.sbin/rbootd/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.11 2013/04/03 03:20:39 deraadt Exp $ */ +/* $OpenBSD: utils.c,v 1.12 2013/08/22 04:43:41 guenther Exp $ */ /* $NetBSD: utils.c,v 1.5.2.1 1995/11/14 08:45:46 thorpej Exp $ */ /* @@ -71,8 +71,10 @@ void DispPkt(RMPCONN *rconn, int direct) { - static char BootFmt[] = "\t\tRetCode:%u SeqNo:%lx SessID:%x Vers:%u"; - static char ReadFmt[] = "\t\tRetCode:%u Offset:%lx SessID:%x\n"; + static const char BootFmt[] = + "\t\tRetCode:%u SeqNo:%x SessID:%x Vers:%u"; + static const char ReadFmt[] = + "\t\tRetCode:%u Offset:%x SessID:%x\n"; struct tm *tmp; struct rmp_packet *rmp; int i, omask; diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index 450e7140db4..5386cc3f4bc 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route6d.c,v 1.56 2013/03/21 04:43:17 deraadt Exp $ */ +/* $OpenBSD: route6d.c,v 1.57 2013/08/22 04:43:41 guenther Exp $ */ /* $KAME: route6d.c,v 1.111 2006/10/25 06:38:13 jinmei Exp $ */ /* @@ -1138,7 +1138,7 @@ riprecv(void) if (iff_find(ifcp, 'N') != NULL) return; - tracet(1, "Recv(%s): from %s.%d info(%d)\n", + tracet(1, "Recv(%s): from %s.%d info(%zd)\n", ifcp->ifc_name, inet6_n2p(&nh), ntohs(fsock.sin6_port), nn); t = time(NULL); diff --git a/usr.sbin/ypserv/makedbm/makedbm.c b/usr.sbin/ypserv/makedbm/makedbm.c index f819b752efa..9a1a7881dcc 100644 --- a/usr.sbin/ypserv/makedbm/makedbm.c +++ b/usr.sbin/ypserv/makedbm/makedbm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makedbm.c,v 1.29 2009/10/27 23:59:57 deraadt Exp $ */ +/* $OpenBSD: makedbm.c,v 1.30 2013/08/22 04:43:41 guenther Exp $ */ /* * Copyright (c) 1994-97 Mats O Jansson <moj@stacken.kth.se> @@ -111,14 +111,16 @@ file_date(char *filename) int status; if (strcmp(filename,"-") == 0) { - snprintf(datestr, sizeof datestr, "%010u", time(0)); + snprintf(datestr, sizeof datestr, "%010lld", + (long long)time(0)); } else { status = stat(filename, &finfo); if (status < 0) { fprintf(stderr, "%s: can't stat %s\n", __progname, filename); exit(1); } - snprintf(datestr, sizeof datestr, "%010u", finfo.st_mtime); + snprintf(datestr, sizeof datestr, "%010lld", + (long long)finfo.st_mtime); } return datestr; } diff --git a/usr.sbin/ypserv/mkalias/mkalias.c b/usr.sbin/ypserv/mkalias/mkalias.c index 58e8806bf14..6f4594318c1 100644 --- a/usr.sbin/ypserv/mkalias/mkalias.c +++ b/usr.sbin/ypserv/mkalias/mkalias.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkalias.c,v 1.24 2010/06/29 03:47:40 deraadt Exp $ */ +/* $OpenBSD: mkalias.c,v 1.25 2013/08/22 04:43:41 guenther Exp $ */ /* * Copyright (c) 1997 Mats O Jansson <moj@stacken.kth.se> @@ -288,7 +288,8 @@ fail: } if (new_db != NULL) { - snprintf(datestr, sizeof datestr, "%010u", time(NULL)); + snprintf(datestr, sizeof datestr, "%010lld", + (long long)time(NULL)); key.dptr = YP_LAST_KEY; key.dsize = strlen(YP_LAST_KEY); val.dptr = datestr; |