Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [Patch] strcmp
Home

[Freeciv-Dev] Re: [Patch] strcmp

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] strcmp
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Mon, 11 Feb 2002 20:53:21 +0100

Dear diary, on Mon, Feb 11, 2002 at 08:21:43PM CET, I got a letter,
where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> The return values of str(n)cmp and mystr(n)casecmp are used as
> boolean. This is bad. Attached patch fixes this.

This is bad. str[n]cmp() returns pointer, thus first you have to compare it
against NULL and second IIRC we don't make explicit compares against NULLs for
pointer return values.

-- 

                                Petr "Pasky" Baudis

* UN*X programmer && admin         * IPv6 guy (XS26 co-coordinator)
* elinks maintainer                * FreeCiv AI hacker
* IRCnet operator
.
I love deadlines.
I love the whooshing sound they make as they fly by.
-- Douglas Adams.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/


[Prev in Thread] Current Thread [Next in Thread]