aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/jot/jot.c
diff options
context:
space:
mode:
authorDiomidis Spinellis <dds@FreeBSD.org>2006-12-03 17:05:04 +0000
committerDiomidis Spinellis <dds@FreeBSD.org>2006-12-03 17:05:04 +0000
commit34785a9fc0994307b052f9527df2653be9cf8b67 (patch)
tree57cf956bbcefedbc658665723842ca2c43b105e0 /usr.bin/jot/jot.c
parent576be2064bc1c30c4e8ad05324d9346b51788ef5 (diff)
downloadsrc-34785a9fc0994307b052f9527df2653be9cf8b67.tar.gz
src-34785a9fc0994307b052f9527df2653be9cf8b67.zip
Notes
Diffstat (limited to 'usr.bin/jot/jot.c')
-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 c1c2de4fe551..34ec76b55f4f 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)