Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mcgill-vision.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!cmcl2!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: net.lang.c Subject: Re: how has C bitten you? Message-ID: <132@mcgill-vision.UUCP> Date: Fri, 23-Aug-85 04:34:51 EDT Article-I.D.: mcgill-v.132 Posted: Fri Aug 23 04:34:51 1985 Date-Received: Sun, 25-Aug-85 02:13:27 EDT References: <228@investor.UUCP> Organization: McGill University, Montreal Lines: 21 [ ... ] > if(telno){ /* should be if(*telno) */ [ ... ] > Print statements showed the telno was being handed to the routine, > but the if said nothing was there. Turns out, on my system, the > address of telno is NULL. I needed to check the contents not the > address! Gee....and I thought a zero pointer was guaranteed not to point to anything valid (K&R says this). Or is NULL not a zero?! No, you are comparing to 0 not NULL. -- der Mouse {ihnp4,decvax,akgua,etc}!utcsri!mcgill-vision!mouse philabs!micomvax!musocs!mcgill-vision!mouse Hacker: One responsible for destroying / Wizard: One responsible for recovering it afterward