diff options
author | 2011-04-18 12:29:59 +0000 | |
---|---|---|
committer | 2011-04-18 12:29:59 +0000 | |
commit | c9ed995f7c5ab589405e2f8e66b223a445c5522d (patch) | |
tree | f2d955b30ebe427b9fef5c4b89b338691a79dc5f | |
parent | Improve the iked acquire mode peer <-> policy matching. This change (diff) | |
download | wireguard-openbsd-c9ed995f7c5ab589405e2f8e66b223a445c5522d.tar.xz wireguard-openbsd-c9ed995f7c5ab589405e2f8e66b223a445c5522d.zip |
Print size_t with %zu and ssize_t with %zd in error/debug output.
Not %d or %u. May help some of the issues reported by Richard Toohey.
Tested by Steven R. Gerber.
-rw-r--r-- | usr.bin/rdist/child.c | 6 | ||||
-rw-r--r-- | usr.bin/rdist/common.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/rdist/child.c b/usr.bin/rdist/child.c index 7de8236a779..ab2b4f0a843 100644 --- a/usr.bin/rdist/child.c +++ b/usr.bin/rdist/child.c @@ -1,4 +1,4 @@ -/* $OpenBSD: child.c,v 1.15 2011/04/10 15:47:28 krw Exp $ */ +/* $OpenBSD: child.c,v 1.16 2011/04/18 12:29:59 krw Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -196,7 +196,7 @@ readchild(CHILD *child) */ while ((amt = read(child->c_readfd, rbuf, sizeof(rbuf))) > 0) { /* XXX remove these debug calls */ - debugmsg(DM_MISC, "[readchild(%s, %d, %d) got %lld bytes]", + debugmsg(DM_MISC, "[readchild(%s, %d, %d) got %zd bytes]", child->c_name, child->c_pid, child->c_readfd, amt); (void) xwrite(fileno(stdout), rbuf, amt); @@ -205,7 +205,7 @@ readchild(CHILD *child) child->c_name, child->c_pid, child->c_readfd); } - debugmsg(DM_MISC, "readchild(%s, %d, %d) done: amt = %lld errno = %d\n", + debugmsg(DM_MISC, "readchild(%s, %d, %d) done: amt = %zd errno = %d\n", child->c_name, child->c_pid, child->c_readfd, amt, errno); /* diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c index 4a3ea958786..261ee6b1788 100644 --- a/usr.bin/rdist/common.c +++ b/usr.bin/rdist/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.24 2011/04/10 15:47:28 krw Exp $ */ +/* $OpenBSD: common.c,v 1.25 2011/04/18 12:29:59 krw Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -859,7 +859,7 @@ xmalloc(size_t amt) char *ptr; if ((ptr = (char *)malloc(amt)) == NULL) - fatalerr("Cannot malloc %d bytes of memory.", amt); + fatalerr("Cannot malloc %zu bytes of memory.", amt); return(ptr); } @@ -873,7 +873,7 @@ xrealloc(char *baseptr, size_t amt) char *new; if ((new = (char *)realloc(baseptr, amt)) == NULL) - fatalerr("Cannot realloc %d bytes of memory.", amt); + fatalerr("Cannot realloc %zu bytes of memory.", amt); return(new); } @@ -887,7 +887,7 @@ xcalloc(size_t num, size_t esize) char *ptr; if ((ptr = (char *)calloc(num, esize)) == NULL) - fatalerr("Cannot calloc %d * %d = %d bytes of memory.", + fatalerr("Cannot calloc %zu * %zu = %zu bytes of memory.", num, esize, num * esize); return(ptr); @@ -903,7 +903,7 @@ xstrdup(const char *str) char *nstr = (char *) malloc(len); if (nstr == NULL) - fatalerr("Cannot malloc %u bytes of memory.", len); + fatalerr("Cannot malloc %zu bytes of memory.", len); return(memcpy(nstr, str, len)); } |