Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!ericom!eos.ericsson.se!epames From: epames@eos.ericsson.se (Michael Salmon) Newsgroups: comp.lang.c Subject: Re: What's so bad about scanf anyway??? (really what's bad about gets) Message-ID: <1990Nov27.110005.7203@ericsson.se> Date: 27 Nov 90 11:00:05 GMT References: <3797@skye.ed.ac.uk> <1990Nov22.071319.3222@ericsson.se> <3819@skye.ed.ac.uk> Sender: news@ericsson.se Reply-To: epames@eos.ericsson.se Organization: Ericsson Telecom AB Lines: 24 In article <3819@skye.ed.ac.uk> Richard Tobin writes: >In article <1990Nov22.071319.3222@ericsson.se> epames@eos.ericsson.se writes: > >>>>>Let represent your end-of-file character on a UNIX system > >>^D is *NOT* an eof character, it is a command to the tty driver to send >>the contents of the input buffer, > >I thought I had made it quite clear what happens when you type ^D. > >Are you trying to make a substantial point here, or are you just >quibbling about the term "end-of-file character"? I think that the substantial point is that there is no "end-of-file character". End of file is a read() of zero characters, when reading from a terminal this can be achieved by typing ^D (usually) with a blank line. The end of file indication requires both conditions. Getting back to gets(), it behaved exactly as I expected it would and as the manuals say it should. Solely the opinion of Michael Salmon L.M.Ericsson Stockholm