From fa6affc66e7829b56d728bb229e6c8fa628bde18 Mon Sep 17 00:00:00 2001 From: Patrick McLean Date: Wed, 11 Mar 2015 14:00:59 -0700 Subject: Fix formatting of size_t values In several places the code used a %d format to print a size_t variable. On amd64 at least size_t is an unsigned long, so use %lu instead. An alternative would be to use %ud for size_t and %zd fo ssize_t but not all platforms seem to support that formatter. --- common/tio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/tio.c b/common/tio.c index e00c8c8..8095dfb 100644 --- a/common/tio.c +++ b/common/tio.c @@ -478,8 +478,8 @@ int tio_close(TFILE *fp) retv = tio_flush(fp); #ifdef DEBUG_TIO_STATS /* dump statistics to stderr */ - fprintf(stderr, "DEBUG_TIO_STATS READ=%d WRITTEN=%d\n", fp->bytesread, - fp->byteswritten); + fprintf(stderr, "DEBUG_TIO_STATS READ=%lu WRITTEN=%lu\n", + (unsigned long)fp->bytesread, (unsigned long)fp->byteswritten); #endif /* DEBUG_TIO_STATS */ /* close file descriptor */ if (close(fp->fd)) -- cgit v1.2.3