Skip to content

Commit

Permalink
Cast a size_t for use by printf.
Browse files Browse the repository at this point in the history
There is no reliable and portable way to printf a size_t.  Yes, I
know about %z in C99, but C99 is currently very far from universal.
Yes, I know about PRIuPTR, but that isn't universal either.
  • Loading branch information
madler committed Jan 24, 2015
1 parent d21c4d7 commit 7fe325a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pigz.c
Expand Up @@ -799,7 +799,8 @@ local void log_dump(void)
complain("memory leak: %lu allocs of %lu bytes total",
mem_track.num, mem_track.size);
if (mem_track.max)
fprintf(stderr, "%lu bytes of memory used\n", mem_track.max);
fprintf(stderr, "%lu bytes of memory used\n",
(unsigned long)mem_track.max);
}

/* debugging macro */
Expand Down

0 comments on commit 7fe325a

Please sign in to comment.