summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-10-21 09:02:35 +0200
committerTyge Løvset <[email protected]>2020-10-21 09:02:35 +0200
commitd0d004c8154a40fdcfd5a86b04bc5c610dbcc386 (patch)
tree6c4d7b2756db55b61df2347cdb4c09226e70547a
parent8014ab4e48e7cf41377634742830f1a7ca5b7b7d (diff)
downloadSTC-modified-d0d004c8154a40fdcfd5a86b04bc5c610dbcc386.tar.gz
STC-modified-d0d004c8154a40fdcfd5a86b04bc5c610dbcc386.zip
Added support for regular % formatting as well.
-rw-r--r--stc/cfmt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/stc/cfmt.h b/stc/cfmt.h
index 9b3d8999..379312bb 100644
--- a/stc/cfmt.h
+++ b/stc/cfmt.h
@@ -147,6 +147,10 @@ _cfmt_conv(const char *fmt, ...) {
va_start(args, fmt);
do {
switch ((ch = *fmt)) {
+ case '%':
+ if (fmt[1] == '%') *p++ = *fmt++;
+ else va_arg(args, char *);
+ break;
case '}':
if (fmt[1] == '}') ++fmt;
break;