On Mon, May 19, 2003 at 12:01:36PM +0200, [EMAIL PROTECTED] wrote:
> I think that:

        ...

> should be changed to:
>       if(memcmp(&iph->ip_src,iui->addr1,4)){  

        ...

And I think it should be changed to

        if(memcmp(&iph->ip_src,iui->addr1,4) != 0){  

so that the line in question contains a comparison operator, making it
clear what comparison is being done.

> memcmp returns 0 if they are equal.

...and a negative value if the first argument is less than the second,
and a positive value if the first argument is greater than the second,
so that to compare two byte arrays using a particular comparison
operator, you use "memcmp()" and then use the same comparison operator
to compare the result of "memcmp()" with 0.

The same applies to string comparison routines; they don't return a
Boolean, they return an integer.

Reply via email to