* PATCH: printf bug
@ 2004-03-07 13:17 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2004-03-07 13:17 UTC (permalink / raw)
To: Zsh workers
I forgot to allow for printf size modifiers when adding up the size of
the buffer for printf specifications.
Oliver
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.111
diff -u -r1.111 builtin.c
--- Src/builtin.c 12 Jan 2004 12:09:12 -0000 1.111
+++ Src/builtin.c 7 Mar 2004 13:05:33 -0000
@@ -3151,7 +3151,7 @@
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
Index: Test/B03print.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/B03print.ztst,v
retrieving revision 1.7
diff -u -r1.7 B03print.ztst
--- Test/B03print.ztst 25 Apr 2003 11:19:10 -0000 1.7
+++ Test/B03print.ztst 7 Mar 2004 13:05:33 -0000
@@ -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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-03-07 13:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-07 13:17 PATCH: printf bug Oliver Kiddle
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).