From: Janne Blomqvist Date: Sun, 29 May 2011 13:17:17 +0000 (+0300) Subject: PR 49214 fd_gets should return NULL if nothing was read X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bea6ce4920cab0c065bcc6ae1eb0b26fc582ebe;p=gcc.git PR 49214 fd_gets should return NULL if nothing was read From-SVN: r174395 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1d08da8c3b9..f0e3078e8b3 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2011-05-29 Janne Blomqvist + + PR libfortran/49214 + * runtime/backtrace.c (fd_gets): Return NULL if nothing was read. + 2011-05-29 Janne Blomqvist PR libfortran/19155 diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c index dff4466aa56..943332ab615 100644 --- a/libgfortran/runtime/backtrace.c +++ b/libgfortran/runtime/backtrace.c @@ -95,6 +95,8 @@ fd_gets (char *s, int size, int fd) else { s[i] = '\0'; + if (i == 0) + return NULL; break; } }