Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site investor.UUCP Path: utzoo!linus!philabs!prls!amdimage!amdcad!amd!vecpyr!lll-crg!seismo!rochester!cmu-cs-pt!cadre!pitt!darth!investor!rbp From: rbp@investor.UUCP (Bob Peirce) Newsgroups: net.lang.c Subject: Re: how has C bitten you? Message-ID: <228@investor.UUCP> Date: Thu, 15-Aug-85 19:24:51 EDT Article-I.D.: investor.228 Posted: Thu Aug 15 19:24:51 1985 Date-Received: Tue, 20-Aug-85 06:33:22 EDT Organization: Cookson, Peirce & Co., Pittsburgh, PA Lines: 26 Here's one that trapped me this week. It took much head scratching and debug prints to figure it out. int dial(telno) char *telno; { if(telno){ /* should be if(*telno) */ dial it; } else{ hang up; } } 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! -- Bob Peirce, Pittsburgh, PA uucp: ...!{allegra, bellcore, cadre, idis} !pitt!darth!investor!rbp 412-471-5320 NOTE: Mail must be < 30,000 bytes/message