summaryrefslogtreecommitdiff
path: root/source/fitz/printf.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-08-07 13:11:07 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-08-07 13:14:02 +0800
commit20f54e4906be00aa303a8df36f312c137182d1c6 (patch)
tree06d2617b021a303969e837ede00ffcad92908429 /source/fitz/printf.c
parent9110e5d8f5ed4945c416ce6732f86bd16284d7ea (diff)
downloadmupdf-20f54e4906be00aa303a8df36f312c137182d1c6.tar.xz
Fix fz_vsnprintf() so it prints %zu.
Previously we might and up with prints such as: error: malloc of array (%zu x %zu bytes) failed because %zu was never interpreted on 32-bit platforms where sizeof(size_t) < 8. After this fix we now get: error: malloc of array (14445 x 118800 bytes) failed
Diffstat (limited to 'source/fitz/printf.c')
-rw-r--r--source/fitz/printf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/fitz/printf.c b/source/fitz/printf.c
index 8d6bfb0d..2246b4c9 100644
--- a/source/fitz/printf.c
+++ b/source/fitz/printf.c
@@ -197,6 +197,8 @@ fz_vsnprintf(char *buffer, size_t space, const char *fmt, va_list args)
case 'z':
if (sizeof(size_t) >= 8)
length = 64;
+ else
+ length = 32;
break;
case 'Z':
if (sizeof(fz_off_t) >= 8)