*BSD News Article 18593


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!darwin.sura.net!haven.umd.edu!uunet!emba-news.uvm.edu!trantor.emba.uvm.edu!wollman
From: wollman@trantor.emba.uvm.edu (Garrett Wollman)
Subject: Re: Using gets() [ Was Re: nn ]
Message-ID: <1993Jul18.183850.14037@uvm.edu>
Sender: news@uvm.edu
Organization: University of Vermont, EMBA Computer Facility
References: <226q88INN56k@xs4all.hacktic.nl> <1993Jul17.203914.25267@fwi.uva.nl> <229qig$53k@pdq.coe.montana.edu> <OLEG.93Jul17185604@gd.cs.csufresno.edu>
Date: Sun, 18 Jul 1993 18:38:50 GMT
Lines: 24

In article <OLEG.93Jul17185604@gd.cs.csufresno.edu> oleg@gd.cs.CSUFresno.EDU (Oleg Kibirev) writes:
>There is nothing wrong with using gets if there is no good reason for
>input to be longer than some limit.  Like, a response to a yes/no
>question is very unlikely to be longer than 8 characters.  If a user
>wants to break the program, he is welcome to do so (unless it's suid
>or a daemon). I would just compile nn with my own version of gets:

I consider myself in good company (Henry Spencer, Richard Stallman)
when I say that it is absolutely unacceptable for any program to crash
on any input, whether ``reasonable'' or not.  Thus, I don't use gets,
and I tell other people that they shouldn't use it, either.  I pine
for the lack of a snprintf() in the Standard, and the presence of
gets().  I seriously consider `ar d /usr/lib/libc.a gets.o'.

Therefore, I will state again: any new program which uses gets() is
simply and flatly /wrong/.

-GAWollman

-- 
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@emba.uvm.edu | Shashish is the bonding of hearts in spite of distance.
uvm-gen!wollman      | It is a bond more powerful than absence.  We like people
UVM disagrees.       | who like Shashish.  - Claude McKenzie + Florent Vollant