diff --git a/printf.c b/printf.c index f94dc5e..6d7953d 100644 --- a/printf.c +++ b/printf.c @@ -196,6 +196,7 @@ static int getint(char **s) { static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, int *nl_type) { char *a, *z, *s=(char *)fmt; + char buf[32]; unsigned l10n=0, fl; int w, p, xp; union arg arg; @@ -291,6 +292,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, if (!f) continue; + z = buf + sizeof(buf); prefix = "-+ 0X0x"; pl = 0; t = s[-1];