diff options
Diffstat (limited to 'usr.bin/printf/printf.c')
-rw-r--r-- | usr.bin/printf/printf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 90f363c..ad38200 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -173,8 +173,8 @@ next: for (start = fmt;; ++fmt) { if (*fmt == '%') { if (*++fmt != '%') break; - *fmt++ = '\0'; - (void)printf("%s", start); + (void)printf("%.*s", (int)(fmt - start), start); + fmt++; goto next; } } |