[BusyBox 0000980]: patch to avoid "broadcast +" syntax

Roberto A. Foglietta roberto.foglietta at gmail.com
Tue Nov 28 00:44:11 PST 2006


2006/11/28, Roberto A. Foglietta <roberto.foglietta at gmail.com>:
> 2006/11/27, Rob Landley <rob at landley.net>:
> > On Monday 27 November 2006 1:02 pm, Roberto A. Foglietta wrote:
> > > argv is a vector which is not limited by argc so *++argv is always a
> > > good pointer which could be randomly NULL or not.
> >
> > No, argv[argc] should be NULL and none of the ones before it should be.  It's
> > not random, argc is redundant and argv[] is a null terminated array of char
> > pointers.
>
>  Sorry Rob but I was writing about randomness of
>
>  argv[argc+1] ?= NULL
>
>  in fact in the my patched ifconfig code there are two test like this
>
>  if((*++argv) == NULL)
>
>  in which if the first is true (argv[argc]) the second happens but the
> result is random but even the randomness of the result ifconfig do the
> same thing because the two paths join togheter very soon after
> random-result-if and the few code before does not matter because
> setting broadcast is always the last thing ifconfig does.
>

Anyway this "uncommon" situation will be completely eliminated adding a

argv--;

as I show you in paches 2 and 3. Removing some degree of randomness
like this, even at cost some bytes in footprint, is good for any
maintainer.


 Cheers,
-- 
/roberto


More information about the busybox mailing list