U
user923005
whilst I don't think Chuck added much with his comment I'd rather
newbie programmers walked around with the idea in their heads "gets is
impossible
to use safely" than the potentially dangerous "gets is nearly
impossible to
use safely".
I'm curious, have you ever written a program that ran in such a
"marshalled"
environment that used gets() safely. And why didn't you use fgets()?
I like Jack's getsafe(). It's not perfect, but it is a lot safer than
gets() and it is not more difficult to use than gets():
http://home.att.net/~jackklein/ctips01.html#safe_gets