gets(3) nonsense

Dier Retlaw Semaj jwr at scotty.UUCP
Tue Nov 22 04:30:58 AEST 1988


In article <1403 at unisoft.UUCP> achut at unisoft.UUCP (Achut Reddy) writes:
<In article <1643 at solo11.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
<<And now the real point: let's stop complaining about the gets(3) semantics of
<<not checking buffer boundaries; this is precisely what was intended.
<<Does anyone suggest doing away with strcpy() too?
<<Or /bin/rm, being destructive?
<
<No, there is a fundamental difference between gets(3) and all the other
<functions that don't check buffer boundaries.  That difference is that 
<the other functions *can* be used safely if the programmer exercises
<some care.  He has complete control over the arguments he passes to these
>functions, and can ensure that his buffers don't overflow.

What about sprintf() & fprintf()?
The user does not have *complete control* over these functions.

-- 

Dier R. Semaj	{ames,cmcl2,rutgers}!rochester!kodak!fedsys!wally!jwr

--



More information about the Comp.lang.c mailing list