Commit 8bea6ce4 by Janne Blomqvist

PR 49214 fd_gets should return NULL if nothing was read

From-SVN: r174395
parent fa766006
2011-05-29 Janne Blomqvist <jb@gcc.gnu.org> 2011-05-29 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/49214
* runtime/backtrace.c (fd_gets): Return NULL if nothing was read.
2011-05-29 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/19155 PR libfortran/19155
* io/read.c (convert_real): Check for invalid input by comparing * io/read.c (convert_real): Check for invalid input by comparing
endptr instead of EINVAL. endptr instead of EINVAL.
......
...@@ -95,6 +95,8 @@ fd_gets (char *s, int size, int fd) ...@@ -95,6 +95,8 @@ fd_gets (char *s, int size, int fd)
else else
{ {
s[i] = '\0'; s[i] = '\0';
if (i == 0)
return NULL;
break; break;
} }
} }
......
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