compare strings, strcmp

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Fri Nov 17 06:27:37 AEST 1989


In article <308 at charyb.COM> dan at charyb.UUCP (Dan Mick) writes:
| In article <11605 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
| >#define	StrEq( a, b )	(*(a) == *(b) && strcmp( a, b ) == 0)	/* UNSAFE */
| 
| Why the UNSAFE comment?  This looks like utterly standard C to me...

  I can only speculate, but strcmp can give memory faults if the string
is not properly terminated. There may be other reasons I'm missing, I
lost a day's news and don't have the original.
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.lang.c mailing list