diff options
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index b42b01b11..48959e3a8 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -261,6 +261,10 @@ int vsprintf(char *buf, const char *fmt, va_list args) } continue; + case '%': + *str++ = '%'; + continue; + /* integer number formats - set up the flags and "break" */ case 'o': base = 8; @@ -279,8 +283,7 @@ int vsprintf(char *buf, const char *fmt, va_list args) break; default: - if (*fmt != '%') - *str++ = '%'; + *str++ = '%'; if (*fmt) *str++ = *fmt; else @@ -313,4 +316,3 @@ int sprintf(char * buf, const char *fmt, ...) va_end(args); return i; } - |