mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-20 10:53:29 +02:00
19549: correct buffer size for printf spec
This commit is contained in:
parent
2ab4ce8e65
commit
3ee4759f28
@ -1,3 +1,8 @@
|
||||
2004-03-07 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 19549: Src/builtin.c, Test/B03print.ztst: allow for size
|
||||
modifiers in printf format spec's buffer
|
||||
|
||||
2004-03-06 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
|
||||
|
||||
* zsh-users/7121: Doc/Zsh/options.yo, Src/options.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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user