diff options
author | dim <dim@FreeBSD.org> | 2011-12-19 18:08:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-12-19 18:08:31 +0000 |
commit | 9cdf8d529a192db8c34a2f422acef16340624baa (patch) | |
tree | 099405e430f310c433ce286de307db8b921ce8c9 /usr.sbin/timed/timedc | |
parent | 83a41e00af84b93176757e8e08899036e937ccc3 (diff) | |
download | FreeBSD-src-9cdf8d529a192db8c34a2f422acef16340624baa.zip FreeBSD-src-9cdf8d529a192db8c34a2f422acef16340624baa.tar.gz |
In usr.sbin/timed, fix several issues with printf formats:
- Cast time_t's to long, and print them with %ld.
- Print ptrdiff_t's with %td.
- Print ssize_t's and size_t's with %zd and %zu.
- Print int32_t's with %d.
Also, replace some int variables with the more appropriate size_t.
MFC after: 1 week
Diffstat (limited to 'usr.sbin/timed/timedc')
-rw-r--r-- | usr.sbin/timed/timedc/cmds.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/timed/timedc/cmds.c b/usr.sbin/timed/timedc/cmds.c index ab73341..b778b1a 100644 --- a/usr.sbin/timed/timedc/cmds.c +++ b/usr.sbin/timed/timedc/cmds.c @@ -267,7 +267,7 @@ msite(argc, argv) int argc; char *argv[]; { - int cc; + ssize_t cc; fd_set ready; struct sockaddr_in dest; int i, length; @@ -333,7 +333,7 @@ msite(argc, argv) */ if (cc < (sizeof(struct tsp) - MAXHOSTNAMELEN + 32)) { fprintf(stderr, - "short packet (%u/%u bytes) from %s\n", + "short packet (%zd/%zu bytes) from %s\n", cc, sizeof(struct tsp) - MAXHOSTNAMELEN + 32, inet_ntoa(from.sin_addr)); continue; @@ -428,7 +428,7 @@ tracing(argc, argv) { int onflag; int length; - int cc; + ssize_t cc; fd_set ready; struct sockaddr_in dest; struct sockaddr_in from; @@ -489,7 +489,7 @@ tracing(argc, argv) * least long enough to hold a 4.3BSD packet. */ if (cc < (sizeof(struct tsp) - MAXHOSTNAMELEN + 32)) { - fprintf(stderr, "short packet (%u/%u bytes) from %s\n", + fprintf(stderr, "short packet (%zd/%zu bytes) from %s\n", cc, sizeof(struct tsp) - MAXHOSTNAMELEN + 32, inet_ntoa(from.sin_addr)); return; |