chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
struct/dstr-putf.c: Don't segfault on `*' width/precision indicators.
[mLib]
/
struct
/
dstr-putf.c
diff --git
a/struct/dstr-putf.c
b/struct/dstr-putf.c
index 38eb8f6d1c1580c921220b6ecab7184a3df2b348..ba715b19dd334aaead31ca59053ef0df497edcf3 100644
(file)
--- a/
struct/dstr-putf.c
+++ b/
struct/dstr-putf.c
@@
-151,6
+151,7
@@
int dstr_vputf(dstr *d, const char *p, va_list *ap)
*ip = va_arg(*ap, int);
DENSURE(&dd, DSTR_PUTFSTEP);
dd.len += sprintf(dd.buf + dd.len, "%i", *ip);
*ip = va_arg(*ap, int);
DENSURE(&dd, DSTR_PUTFSTEP);
dd.len += sprintf(dd.buf + dd.len, "%i", *ip);
+ p++;
} else {
*ip = *p - '0';
DPUTC(&dd, *p);
} else {
*ip = *p - '0';
DPUTC(&dd, *p);