From 3ee4759f28ab7248790f66516e3a44bd50da1a1e Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 7 Mar 2004 13:29:49 +0000 Subject: 19549: correct buffer size for printf spec --- ChangeLog | 5 +++++ Src/builtin.c | 2 +- Test/B03print.ztst | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ab38428c..45c45ccd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-03-07 Oliver Kiddle + + * 19549: Src/builtin.c, Test/B03print.ztst: allow for size + modifiers in printf format spec's buffer + 2004-03-06 Peter Stephenson * zsh-users/7121: Doc/Zsh/options.yo, Src/options.c, diff --git a/Src/builtin.c b/Src/builtin.c index 48ad69324..fbca0b5f5 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3151,7 +3151,7 @@ bin_print(char *name, char **args, Options ops, int func) int flen, width, prec, type, argc, n, narg; int nnl = 0, ret = 0, maxarg = 0; int flags[5], *len; - char *start, *endptr, *c, *d, *flag, *buf, spec[11], *fmt = NULL; + char *start, *endptr, *c, *d, *flag, *buf, spec[13], *fmt = NULL; char **first, *curarg, *flagch = "0+- #", save = '\0', nullstr = '\0'; size_t rcount, count = 0; #ifdef HAVE_OPEN_MEMSTREAM diff --git a/Test/B03print.ztst b/Test/B03print.ztst index 9a22f2207..5eb94a27e 100644 --- a/Test/B03print.ztst +++ b/Test/B03print.ztst @@ -149,7 +149,7 @@ 0:%n count zeroed on format reuse >1 -# this should fill spec string with '%0+- #*.*d\0' - 11 characters +# this may fill spec string with '%0+- #*.*lld\0' - 13 characters printf '%1$0+- #-08.5dx\n' 123 0:maximal length format specification >+00123 x -- cgit 1.4.1