On 13.10.2008, Tim Brown wrote:
> On Monday 13 October 2008 11:58:07 Bernhard Herzog wrote:
> > AFAICT, the code in nasl_cmd_exec.c depends on anything from glib, so
> > this include shouldn't be necessary.
>
> Well it does at the moment, since I used TRUE and FALSE.

Well, nasl_cmd_exec.c only uses FALSE, and all uses are comparisons with a 
FILE*.  In addition to the one in line 281, there's another one in line 414.

> > Why is the file pointer compared to FALSE?  FALSE is conceptually a
> > boolean and an int whereas fp is a pointer to FILE.  This doesn't make
> > sense.
>
> Oops well caught.  I was trying to avoid using something such as !fp since
> I'm not a big fan of implicit comparisons.
>
> You can tell this code was written late in to the night :(.

Yeah, this kind of thing can happen to anybody.  It might be a good idea to 
take this as an opportunity to extend the NASL test-suite I started in 
openvas-libnasl/test/ a while ago.  Ideally, whenever the NASL interpreter is 
modified and the affected NASL-functions are not already covered by the 
test-suite, a corresponding test should be added before changing the NASL 
interpreter to make sure the behavior at least stays the same.

Regards,

  Bernhard

-- 
Bernhard Herzog  |  ++49-541-335 08 30  |  http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

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

_______________________________________________
Openvas-devel mailing list
Openvas-devel@wald.intevation.org
http://lists.wald.intevation.org/mailman/listinfo/openvas-devel

Reply via email to