summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/printf/printf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index e0d1591..90f363c 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;
OpenPOWER on IntegriCloud