From: Kevin Ashley Newsgroups: comp.os.msdos.djgpp Subject: Re: why is output different each time? Date: Thu, 12 Nov 1998 19:04:38 +0000 Organization: Posted via ULCC Internet Services Lines: 25 Message-ID: <364B3146.41C6@ulcc.ac.uk> References: <01be06da$d35edfc0$5640ab95 AT JUry DOT law DOT unsw DOT edu DOT au> NNTP-Posting-Host: silver.ulcc.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (X11; I; IRIX 5.3 IP22) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Joe Ury wrote: > > Why do I get differing output each time. ...snip... in this loop: > do { > x = (char *)memchr(t, '|', len); > if (x) > *x = '\n'; > } while (x); you exit when x is a NULL pointer. You then immediately use x to do output: > fputs(x,f2); I'm not saying there aren't other problems, but that certainly looks like one to me. ------------------------------------------------------------------------ Kevin Ashley K DOT Ashley AT Ulcc DOT ac DOT uk Special Projects Manager http://www.ulcc.ac.uk/staff/Kevin+Ashley ULCC ...ukc!ncdlab!K.Ashley (but probably not any more) This is not a signature