I use the gets() function a lot in my own programming. I know that:
the input string may overflow the allocated space
in some environments, the above can be used to create an exploit
that fgets() can be used instead to read standard input
that the header declaration has been removed (from stdio.h?)
that use of gets() is not recommended
that gets() is deprecated
But I want to use it anyway; perhaps "saving" a copy of the headers and object code before it disappears altogether.
I don't like fgets() because if the input is too long, it just returns whatever will fit without any indication the string has been truncated. The rest (or at least the next portion) of the string is returned on the next call, which is fine if you're simply writing a program to copy standard input to standard output or a file (why would anyone want to write a program to do that?) but useless if you're processing the data in some way.
Please don't answer the question how do I know the input string has been truncated by fgets()? That is not the question I'm trying to answer. The correct question is how do I use gets() without a lot of warnings of doom and disaster?
And please, no lectures about how I don't want to use gets().
I'm using gcc c under Debian 9; no IDE.