summaryrefslogtreecommitdiffstats
path: root/usr.bin/jot
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/jot')
-rw-r--r--usr.bin/jot/jot.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index c1c2de4..34ec76b 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -393,8 +393,11 @@ getformat(void)
if (boring) /* no need to bother */
return;
for (p = format; *p; p++) /* look for '%' */
- if (*p == '%' && *(p+1) != '%') /* leave %% alone */
- break;
+ if (*p == '%')
+ if (p[1] == '%')
+ p++; /* leave %% alone */
+ else
+ break;
sz = sizeof(format) - strlen(format) - 1;
if (!*p && !chardata) {
if (snprintf(p, sz, "%%.%df", prec) >= (int)sz)
OpenPOWER on IntegriCloud