Never use gets(). Because it is impossible to tell without knowing the data in advance
how many characters gets() will read, and because gets() will continue to store charac‐
ters past the end of the buffer, it is extremely dangerous to use. It has been used to
break computer security. Use fgets() instead.
It's an unsafe function that should never be used.
When found in code, its presence prompts more experienced programmers (those with more than say, 1 day of C programming under their belts) to pound on the pathetic, poor, foolish rookie who put it in his code.