__fgets_chk -- string input, with buffer overflow checking


#include <stdio.h>

char * __fgets_chk(char * s, size_t size, int strsize, FILE * stream);


The interface __fgets_chk() shall function in the same way as the interface fgets(), except that __fgets_chk() shall check for buffer overflow before computing a result. If an overflow is anticipated, the function shall abort and the program calling it shall exit.

The parameter strsize specifies the size of the object pointed to by stream.

The __fgets_chk() function is not in the source standard; it is only in the binary standard.