summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-10-26 14:52:21 +0100
committerTyge Løvset <[email protected]>2020-10-26 14:52:21 +0100
commita04ffa9e4d3478c7af7dd7cbe25764aa061a23de (patch)
treeb5dd31bfaeeb82717614840abcc3c84f36321dc5
parentf483b9bb7add22ca7b638281965246c895ca2160 (diff)
downloadSTC-modified-a04ffa9e4d3478c7af7dd7cbe25764aa061a23de.tar.gz
STC-modified-a04ffa9e4d3478c7af7dd7cbe25764aa061a23de.zip
Another minor.
-rw-r--r--stc/cfmt.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/stc/cfmt.h b/stc/cfmt.h
index 642ed971..483d97d9 100644
--- a/stc/cfmt.h
+++ b/stc/cfmt.h
@@ -208,10 +208,11 @@ _cfmt_conv(int nargs, const char *fmt, ...) {
arg = va_arg(args, char *);
*p++ = '%'; p0 = p; align = 0;
while (1) switch (*fmt) {
- case '}': case '\0': goto done;
- case '<': *p++ = '-', ++fmt, align = 1; break;
- case '>': ++fmt, align = 1; break;
+ case '\0': goto done;
+ case '}': ++fmt; goto done;
case '-': ++fmt; break;
+ case '>': ++fmt, align = 1; break;
+ case '<': *p++ = '-', ++fmt, align = 1; break;
case '*': if (++n <= nargs) arg = va_arg(args, char *); /* nobreak */
default: *p++ = *fmt++;
}
@@ -222,7 +223,6 @@ _cfmt_conv(int nargs, const char *fmt, ...) {
memmove(p0+1, p0, p-p0), *p0 = '+', *p++ = 'd';
else if (!align && strchr("cs", p[-1]))
memmove(p0+1, p0, p-p0), *p0 = '-', ++p;
- fmt += (*fmt == '}');
continue;
}
*p++ = *fmt++;