Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2015-03-11 22:00:59 +0100
committerArthur de Jong <arthur@arthurdejong.org>2015-03-14 11:15:43 +0100
commitfa6affc66e7829b56d728bb229e6c8fa628bde18 (patch)
treeaf0cd83cbaccfd1e73953637204140ecd6d994bd /common
parent246aba5ef80d8385053be9205fe8984172a9fc08 (diff)
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.
Diffstat (limited to 'common')
-rw-r--r--common/tio.c4
1 files changed, 2 insertions, 2 deletions
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))