diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-03-23 13:33:15 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-03-23 13:33:32 +0100 |
commit | 185d530d3b3a6f8be63dd7cfc3f2b7784066707c (patch) | |
tree | a4f54d34304c2b7499ba3405a5d6944a08bbf144 | |
parent | 67bc3a7fc0dce49c762d22cafdcfa2a330e5e97e (diff) | |
download | mupdf-185d530d3b3a6f8be63dd7cfc3f2b7784066707c.tar.xz |
Fix bug with printing integer zero in printf.
-rw-r--r-- | source/fitz/printf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/fitz/printf.c b/source/fitz/printf.c index ab87e2e9..cea13cc1 100644 --- a/source/fitz/printf.c +++ b/source/fitz/printf.c @@ -82,6 +82,8 @@ static void fmtuint32(struct fmtbuf *out, unsigned int a, int s, int z, int w, i int i; i = 0; + if (a == 0) + buf[i++] = '0'; while (a) { buf[i++] = fz_hex_digits[a % base]; a /= base; @@ -100,6 +102,8 @@ static void fmtuint64(struct fmtbuf *out, uint64_t a, int s, int z, int w, int b int i; i = 0; + if (a == 0) + buf[i++] = '0'; while (a) { buf[i++] = fz_hex_digits[a % base]; a /= base; |