Commit 497a9a20 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in ngetdelim(), set errno to EINVAL if stream is not a valid file

stream; this matches the manual page


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3617 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 1 deletion
+5 -1
......@@ -333,6 +333,9 @@ CVS code -
- Unconditionally blank the statusbar as soon as we're finished
getting input. (DLR, suggested by Benno Schulenberg)
- utils.c:
ngetdelim()
- Set errno to EINVAL if stream is not a valid file stream.
This matches the manual page. (DLR)
nperror()
- Simplify. (DLR)
- winio.c:
......
......@@ -197,7 +197,8 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
int c;
/* Sanity checks. */
if (lineptr == NULL || n == NULL || stream == NULL) {
if (lineptr == NULL || n == NULL || stream == NULL ||
fileno(stream) == -1) {
errno = EINVAL;
return -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment