gets3
Get a string from standard input (deprecated)
Usage
#include <stdio.h>
[[deprecated]] char *gets(char *s);
Library
Standard C library (libc, -lc)
Overview
Never use this function.
gets() reads a line from stdin into the buffer pointed to by s until either a terminating newline or EOF, which it replaces with a null byte ('\0'). No check for buffer overrun is performed (see BUGS below).
Return value
gets() returns s on success, and NULL on error or when end of file occurs while no characters have been read. However, given the lack of buffer overrun checking, there can be no guarantees that the function will even return.
Attributes
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| gets() | Thread safety | MT-Safe |
Releases
19 releases since Debian 1.1 (Buzz); the text changed 15 times.