From: Mark Wooding Date: Sat, 14 Jun 2014 23:24:48 +0000 (+0100) Subject: struct/dstr-putf.c: Don't segfault on `*' width/precision indicators. X-Git-Tag: 2.2.2~4 X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/commitdiff_plain/e744e21a5aa1e4e5820999ac1e6776fa8fe76dd8 struct/dstr-putf.c: Don't segfault on `*' width/precision indicators. Must have always been broken. Strange: I thought I'd tested that. --- diff --git a/struct/dstr-putf.c b/struct/dstr-putf.c index 38eb8f6..ba715b1 100644 --- 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); + p++; } else { *ip = *p - '0'; DPUTC(&dd, *p);