Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!eru!luth!sunic!draken!matsl From: matsl@nada.kth.se (Mats Luthman) Newsgroups: comp.lang.c Subject: Re: compare strings, strcmp Keywords: strcmp,strings Message-ID: <2355@draken.nada.kth.se> Date: 21 Nov 89 08:34:59 GMT References: <4463@blake.acs.washington.edu> <11605@smoke.BRL.MIL> <308@charyb.COM> <309@charyb.COM> <5139@mnetor.UUCP> Reply-To: matsl@nada.kth.se (Mats Luthman) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 10 In article <5139@mnetor.UUCP> lazer@mnetor.UUCP (Lazer Danzinger) writes: >+>In article <11605@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >+>>#define StrEq( a, b ) (*(a) == *(b) && strcmp( a, b ) == 0) >+>>/* UNSAFE */ >+ > I see no possibility of side effects. What is unsafe is the > referencing of the location where a and b point to, without > first checking that they are not null pointers. Try StrEq(foo--, bar--)