On Thu, 6 Jul 2000, Tom Lane wrote:
> I've occasionally griped that I do not like the coding practice of
> writing
> if (strcmp(foo, bar))
> to mean
> if (strcmp(foo, bar) != 0)
Why not define a macro to avoid the urge to take shortcuts like that in
the future?
#define streq(a,b) (strcmp((a), (b))==0)
This is guaranteed to yield 1 or 0, and it's very readable.
--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden