Subject: Re: gets()
To: None <, m-sw2360@HAPPY.CS.NYU.EDU>
From: Shao Ai Wu <>
List: current-users
Date: 03/11/1994 18:07:53
>> these should be the good reasons for removing the *broken* gets().
>> Removing gets() solves the long term problem, and fits into the
>> "budgets" for "laziness", too.  
>Loathesome though gets() is, it really ought to stay.  NetBSD will be
>taken more seriously if it can honestly claim ANSI C conformance (plus,
>it would be awfully nice to one day get "UNIX" branding, assuming (a) that
>doesn't turn out to be a sham by Novell, and (b) it doesn't end up costing
>as much as a UNIX source license does today...).
>On the other hand, "ANSI C conformance" can involve linking with

The problem with gets() is that it has no idea about the size
of the buffer; nasty bugs can be created due to overflow.
I personally don't use gets() at all; I reinvent the function
, getString (char *buf, int size), each time I need one.

On the other hand, fgets() is much better than gets().

It might be a better idea to separate the C library from
Unix -- remove all C functions and put them into separate
libraries, such as "libansic" or something like that.