What's so bad about scanf anyway??? (really what's bad about gets)

Doug Gwyn gwyn at smoke.brl.mil
Fri Nov 16 21:55:34 AEST 1990


In article <879 at jonlab.UUCP> jon at jonlab.UUCP (Jon H. LaBadie) writes:
>Is this just "conventional wisdom", or does something in the choice
>of BUFSIZ for a particular system ensure any overflow protection?

gets() will input arbitrarily long lines.
The only thing really special about BUFSIZ in this regard is that
many UNIX text editors do not support lines longer than that, so
text files containing longer lines are rarely encountered (but
not impossible).



More information about the Comp.lang.c mailing list