1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2025-05-31 08:31:41 +05:30

freadln.c: set errno to EINVAL if output is NULL

This commit is contained in:
2025-03-02 13:49:16 +03:00
parent 76f0fe22db
commit 2e294a2047

View File

@@ -27,8 +27,10 @@ int freadln(FILE* f, char** output, size_t* length_out) {
* freadln_ERROR: an error occurred (see errno)
*/
if (output == NULL)
if (output == NULL) {
errno = EINVAL;
return freadln_ERROR;
}
// NOTE: if the file is STDIN, flush STDOUT before waiting for input to
// make sure a prompt is displayed