[Stgt-devel] Pointer tested for being negative: a bug ?

Bart Van Assche bart.vanassche
Fri Dec 21 08:54:29 CET 2007


Hello,

In file tgtd.c I found the following source code:

static void set_show_results(struct tgtadm_rsp *rsp, int *err)
{
	if (err < 0)
		rsp->err = *err;
	else {
...

I assume that the test (err < 0) should have been (*err < 0) ? It
doesn't make sense to test whether a pointer is negative.

-- 
Regards,

Bart Van Assche.



More information about the stgt mailing list