retiring gets(3)

Guy Harris guy at auspex.UUCP
Sat Nov 12 03:51:14 AEST 1988


>What's to prevent the following...

Nothing, other than intelligence on the part of the programmer. 
However, unless your application can guarantee that the input will
*never* have overly-long lines (or can hand a buffer *so* immense to
"gets" that it won't matter - but consider how big a buffer might well
have to be), there's nothing to prevent a blowup in a program using
"gets()".

I don't know that I'd argue that "gets()" should be removed, especially
since it's in the dpANS.  I would, however, argue that it should *never*
be used.



More information about the Comp.lang.c mailing list