Path: utzoo!attcan!uunet!husc6!bu-cs!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <1276@X.UUCP> Date: 17 Nov 88 05:13:00 GMT References: <5450@saturn.ucsc.edu> <660023@hpclscu.HP.COM> Organization: Servants of the Great White Frog Lines: 19 In article <660023@hpclscu.HP.COM>, shankar@hpclscu.HP.COM (Shankar Unni) writes: > > gets() has legitimate uses. It is in the library Base Document. > > It is widely used in existing code (sometimes safely, sometimes not). > > It stays. > Exactly how do you use gets "safely"? The only case I can think of is when you have a process that fork()s, and the parent feeds the child stuff which is guaranteed to fit into the buffer. I used to think that parsing machine-generated output files was another case. Then one day my program for analyzing /usr/spool/uucp/SYSLOG started blowing out because I had run out of space during a uucp transfer... gets. A clock-tick of convenience. A process-lifetime of regret. :-) -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101 ...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu Science does not remove the TERROR of the Gods!