Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!uunet!zephyr.ens.tek.com!tektronix!reed!intelhf!ichips!iWarp.intel.com!inews!pima!bhoughto From: bhoughto@pima.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: Trouble at EOF Message-ID: <4751@inews.intel.com> Date: 17 Jun 91 18:12:23 GMT References: <12847@pucc.Princeton.EDU> <4739@inews.intel.com> <1991Jun17.120927.3802@watmath.waterloo.edu> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 29 In article <1991Jun17.120927.3802@watmath.waterloo.edu> datangua@watmath.waterloo.edu (David Tanguay) writes: >In article <4739@inews.intel.com> bhoughto@pima.intel.com (Blair P. Houghton) writes: > > while ( fgets(s, sizeof s, stream) ) > > process(s); > > if ( strlen(s) != 0 ) { > > /* there's something left to process */ > >Huh? 4.9.7.2: "If end-of-file is encountered and no characters have been read [...etc...] Urp! Remind me: a. To test code before I post it. b. Not to do it this way... Spoiler alert. If there's anything you don't want to know, don't turn the page... --Blair "Uh, er, uh, Bob made me do it. Yeah, that's it. Everyone thinks that Agent Cooper is the only one he's infested, but he's got me in his clutches now, too. Yeah. That's the ticket..."