diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index e0d1591b50c..90f363cbc8a 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -376,7 +376,11 @@ escape(fmt) value += *fmt - '0'; } --fmt; - *store = value; + if (value == '%') { + *store++ = '%'; + *store = '%'; + } else + *store = value; break; default: *store = *fmt;