[PATCH] Re: 4.0 core dump from printf -v foo %s b

2009-11-12 Thread Greg Wooledge
On Thu, Nov 12, 2009 at 02:37:58PM -0500, Chet Ramey wrote: > I try to write to the current (well, ten-year-old) standards. The > replacement in lib/sh/snprintf.c behaves as C99 specifies; you might try > using it by #undefing HAVE_VSNPRINTF and HAVE_SNPRINTF in config.h. Ah, wonderful. I wasted

Re: for i in {1..100000...

2009-11-12 Thread Jan Schampera
Antonio Macchi schrieb: > what's the rasonable limit in using this "compact" contruct, after which > the for (( i=0; i<1000...; i++ )) became better? Hardware/OS limits. J.

Re: 4.0 core dump from printf -v foo %s b

2009-11-12 Thread Chet Ramey
Andreas Schwab wrote: > Greg Wooledge writes: > >> It doesn't mention a null pointer. The OpenBSD man page does explicitly >> say the null pointer is allowed if size is zero. The GNU/Linux man page >> says that SUSv2 and C99 disagree, but that the implementation follows >> C99 (allowing the nul

Re: qwerty

2009-11-12 Thread Antonio Macchi
http://www.opengroup.org/onlinepubs/9699919799/utilities/printf.html#tag_20_94 (ouch!) ok! thanks!

Re: qwerty

2009-11-12 Thread pk
Antonio Macchi wrote: > I'm on error, I know... but, in your bash-ref guide you don't explain a > lot printf > > and in man printf don't do it too... > > from man printf > - > NOTE: your shell may have its own version of printf, which usually > supersedes the versio

Re: qwerty

2009-11-12 Thread Chet Ramey
Antonio Macchi wrote: > I'm on error, I know... but, in your bash-ref guide you don't explain a > lot printf > > and in man printf don't do it too... http://www.opengroup.org/onlinepubs/9699919799/utilities/printf.html#tag_20_94 -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: qwerty

2009-11-12 Thread Antonio Macchi
I'm on error, I know... but, in your bash-ref guide you don't explain a lot printf and in man printf don't do it too... from man printf - NOTE: your shell may have its own version of printf, which usually supersedes the version described here. Please refer to your s

Re: for i in {1..100000...

2009-11-12 Thread pk
Antonio Macchi wrote: > what's the rasonable limit in using this "compact" contruct, after which > the for (( i=0; i<1000...; i++ )) became better? You didn't even bother trying eh? $ for i in {0..10}; do echo $i>/dev/null; done bash: xmalloc: ../../../bash/lib/sh/stringvec.c:40: cann

for i in {1..100000...

2009-11-12 Thread Antonio Macchi
what's the rasonable limit in using this "compact" contruct, after which the for (( i=0; i<1000...; i++ )) became better?

Re: 4.0 core dump from printf -v foo %s b

2009-11-12 Thread Andreas Schwab
Greg Wooledge writes: > It doesn't mention a null pointer. The OpenBSD man page does explicitly > say the null pointer is allowed if size is zero. The GNU/Linux man page > says that SUSv2 and C99 disagree, but that the implementation follows > C99 (allowing the null pointer when size is 0). No

Re: 4.0 core dump from printf -v foo %s b

2009-11-12 Thread Greg Wooledge
On Wed, Nov 11, 2009 at 09:41:29PM -0500, Chet Ramey wrote: > If your version of vsnprintf doesn't behave like that, I claim it's a > bug. The Posix and C standards explicitly allow the buffer to be NULL > if the size argument is 0, and guarantee that no data will be written > in this case. Thank