retiring gets(3)

00704a-Wallis snafu at ihlpm.ATT.COM
Fri Nov 11 04:38:06 AEST 1988


In article <8841 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn ) writes:
... text deleted ...
> By the way, have you removed scanf() from your C library as well?  Or
> sprintf()?  Or strcpy()?  They can be misused in the same way as gets().
> Let us know how happy your customers are once ALL such routines are gone.
> 
....

Actually, I don't understand the argument that
gets() should be removed because it can overrun
the buffer. What's to prevent the following (and
how is it different from gets?):

	char	some_string[10];

	fgets( some_string, 2147483647, stdin );


--
Dave Wallis
AT&T Network Systems
Lisle, IL 60532

att!ihlpm!snafu



More information about the Comp.lang.c mailing list