diff options
Diffstat (limited to 'src/stdio/gets_s.c')
-rw-r--r-- | src/stdio/gets_s.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/stdio/gets_s.c b/src/stdio/gets_s.c new file mode 100644 index 00000000..5af016dd --- /dev/null +++ b/src/stdio/gets_s.c @@ -0,0 +1,33 @@ +#include "stdio.h" +#include <limits.h> + +/** read a line from stdin **/ +char * gets_s(char *s, rsize_t n) +{ + __C_EXT(1, 201112L); + return fgets(s, INT_MAX, stdin); +} + +/*** +The fn(gets) function does no bounds checking, is marked obsolete in C99, and +has been removed from C11. It is a security risk and should not be used. + +The fn(gets) function reads a line of input from macro(stdin) into the array +arg(s). Input characters are read until a newline or end-of-file is reached. The +newline will not be appended to arg(s). A char(\0) character will be written +after the last character read into the array. + +If end-of-file is reached before any characters are read, the contents of arg(s) +remain unchanged. +***/ + +/* UNSPECIFIED: - */ +/* UNDEFINED: - */ +/* IMPLEMENTATION: - */ +/* LOCALE: - */ + +/* RETURN(EOF): end-of-file was reached with no characters read; or, an error occurred */ + +/* +CEXT1(201112) +*/ |