Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!sun-barr!newstop!texsun!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: EOF considered harmful Message-ID: <6645@ficc.uu.net> Date: 23 Oct 89 17:45:26 GMT References: <266@m1.cs.man.ac.uk> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 22 > while ( ! feof(stdin) ) { > ch= getchar(); > putchar(ch); > } > 5) Although, to my mind, the above is a compelling argument to abandon the > explicit test for EOF, everyone reading this newsgroup (except me of > course :-) ) will ignore it! The fact that it appends a 0xFF byte to the output is, of course, quite irrelevant. I did exactly the same thing (though in a much more complex loop) about eight years ago. It didn't take more than 15 minutes to find it, but I'd already posted the program on a local CP/M bulletin board so it took a little longer to get over the embarrasment. If CP/M didn't use ^Z as EOF it would have been a much quicker fix. -- Peter da Silva, *NIX support guy @ Ferranti International Controls Corporation. Biz: peter@ficc.uu.net, +1 713 274 5180. Fun: peter@sugar.hackercorp.com. `-_-' "I feared that the committee would decide to go with their previous 'U` decision unless I credibly pulled a full tantrum." -- dmr@alice.UUCP