On Tuesday 17 March 2009 13:55:18 Scott Wood wrote:
> On Tue, Mar 17, 2009 at 01:49:20PM -0400, Mike Frysinger wrote:
> > On Tuesday 17 March 2009 13:10:15 Scott Wood wrote:
> > > --- a/common/cmd_nand.c
> > > +++ b/common/cmd_nand.c
> > > @@ -502,7 +502,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp,
> > > nand_info_t *nand,
> > >
> > >   s = strchr(cmd, '.');
> > >   if (s != NULL &&
> > > -     (strcmp(s, ".jffs2") && !strcmp(s, ".e") && !strcmp(s, ".i"))) {
> > > +     (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
> >
> > unrelated to the bug in question, but perhaps better written like:
> > if (s++ != NULL &&
> >     (strcmp(s, "jffs2") && strcmp(s, "e") && strcmp(s, "i"))) {
>
> That'd make s non-NULL and invalid, if it started out as NULL.  Even if s
> is not referenced again, it's not a nice thing to leave lurking in the
> code.

i know it does, but since s isnt used again in the code in the NULL case, it 
doesnt matter.  but if you want to be pedantic, it's easy enough to split the 
operations.
if (s != NULL && ++s && ....
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to