diff options
author | Jason Evans <je@fb.com> | 2014-01-22 17:00:27 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2014-01-22 17:00:27 (GMT) |
commit | 0c4e743eaf2ab6bcfd56e002fb82f95801b9292e (patch) | |
tree | 0f4ead2f0a836d8af7d8ed76d6a91c6e220b8c24 /src | |
parent | 0dec3507c62efac909e204217bf9b6c8c59d10ac (diff) | |
download | jemalloc-0c4e743eaf2ab6bcfd56e002fb82f95801b9292e.zip jemalloc-0c4e743eaf2ab6bcfd56e002fb82f95801b9292e.tar.gz jemalloc-0c4e743eaf2ab6bcfd56e002fb82f95801b9292e.tar.bz2 |
Test and fix malloc_printf("%%").
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -400,11 +400,6 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) unsigned char len = '?'; f++; - if (*f == '%') { - /* %% */ - APPEND_C(*f); - break; - } /* Flags. */ while (true) { switch (*f) { @@ -495,6 +490,11 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) switch (*f) { char *s; size_t slen; + case '%': + /* %% */ + APPEND_C(*f); + f++; + break; case 'd': case 'i': { intmax_t val JEMALLOC_CC_SILENCE_INIT(0); char buf[D2S_BUFSIZE]; @@ -561,8 +561,7 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) APPEND_PADDED_S(s, slen, width, left_justify); f++; break; - } - default: not_reached(); + } default: not_reached(); } break; } default: { |