retiring gets(3)
Richard A. O'Keefe
ok at quintus.uucp
Mon Nov 14 19:49:03 AEST 1988
In article <7963 at bloom-beacon.MIT.EDU> scs at adam.pika.mit.edu (Steve Summit) writes:
>In article <1988Nov8.054845.23998 at utstat.uucp> geoff at utstat.uucp (Geoff Collyer) writes:
>>...gets is a bug waiting to happen and should be stamped out.
>
>Getting rid of gets is an excellent idea. I'm all for backwards
>compatibility and not breaking existing code, but it's got to be
>conscientiously written existing code, and to my way of thinking
>no reasonable program should ever have been using gets.
>(Apologies and condolences to those of you who do, and to the
>original implementor.)
When I am writing a program for my own use to process my own data
sets which I _know_ have reasonable lines, why the d---l shouldn't
I use gets()? If I am writing a program for _other_ people to use,
I have an obligation to try to make it reasonably robust, but a lot
of my C programs are there for a day (I find it easier to write C
than awk, better debugging tools to start with... -- would a lint
for awk be called lawk?).
I have just posted a "safe gets" to comp.sources.misc.
More information about the Comp.lang.c
mailing list