Path: utzoo!attcan!sobmips!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: compare strings, strcmp Keywords: strcmp,strings Message-ID: <1632@crdos1.crd.ge.COM> Date: 16 Nov 89 19:27:37 GMT References: <4463@blake.acs.washington.edu> <11605@smoke.BRL.MIL> <308@charyb.COM> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 14 In article <308@charyb.COM> dan@charyb.UUCP (Dan Mick) writes: | In article <11605@smoke.BRL.MIL> gwyn@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@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