From e4ddc8f72b5a7d8c55a6c2042c7b7f945ba4b1a2 Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Sat, 4 Sep 2010 11:30:18 -0400 Subject: fix errors in printf-style format strings There were many places where the arguments to a printf-like function did not match the format string. Mostly, these were a missing 'l' flag, but there were three exceptions: - In ui-stats.c, a size_t argument must be printed. C99 has the "%zu" flag for this purpose, but not all compilers support this. Therefore, we mimic what git does - use a NO_C99_FORMAT Makefile variable. - In ui-stats.c, cgit_print_error() was called with a pointer instead of a character. - In ui-log.c, the "columns" argument was never used. Signed-off-by: Mark Lodato --- ui-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 75ec9cb..0cdbf6d 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -67,7 +67,7 @@ static void print_binary_buffer(char *buf, unsigned long size) html("\n"); html(""); for (ofs = 0; ofs < size; ofs += ROWLEN, buf += ROWLEN) { - htmlf("
ofshex dumpascii
%04x", ofs); + htmlf("
%04lx", ofs); for (idx = 0; idx < ROWLEN && ofs + idx < size; idx++) htmlf("%*s%02x", idx == 16 ? 4 : 1, "", @@ -108,7 +108,7 @@ static void print_object(const unsigned char *sha1, char *path, const char *base html(")\n"); if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) { - htmlf("
blob size (%dKB) exceeds display size limit (%dKB).
", + htmlf("
blob size (%ldKB) exceeds display size limit (%dKB).
", size / 1024, ctx.cfg.max_blob_size); return; } -- cgit v1.2.3-54-g00ecf