Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!s1!jrk From: jrk@s1.sys.uea.ac.uk (Richard Kennaway CMP RA) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <182@s1.sys.uea.ac.uk> Date: 10 Nov 88 12:34:25 GMT References: <1988Nov8.054845.23998@utstat.uucp> <1031@cps3xx.UUCP> Organization: UEA, Norwich, UK Lines: 18 Not being a Real Programmer (tm), I had to look in the Unix manual to see what the fuss was about. The gist of the entry for gets(3) is: NAME gets, fgets - get a string from a stream SYNOPSIS char *gets(s) gets reads characters from the standard input stream, stdin, into the array pointed to by s, until a new-line character is read or an end-of-file condition is encountered. In other words, gets will read an *arbitrarily large* amount of data from the file and place it in memory, beginning at &(s[0]). Presumably the programmer must guess a suitable amount of memory to allocate for s, then pray that no-one ever runs his program on a file with very long lines. Words fail me.