aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/backtrace.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2011-05-29 16:17:17 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2011-05-29 16:17:17 +0300
commit8bea6ce4920cab0c065bcc6ae1eb0b26fc582ebe (patch)
treebb8ede82e2230ffdeb4ede2295decf8c03b48c5c /libgfortran/runtime/backtrace.c
parentfa7660069590bd9620cc50c003f13cb7fbd24e59 (diff)
downloadgcc-8bea6ce4920cab0c065bcc6ae1eb0b26fc582ebe.zip
gcc-8bea6ce4920cab0c065bcc6ae1eb0b26fc582ebe.tar.gz
gcc-8bea6ce4920cab0c065bcc6ae1eb0b26fc582ebe.tar.bz2
PR 49214 fd_gets should return NULL if nothing was read
From-SVN: r174395
Diffstat (limited to 'libgfortran/runtime/backtrace.c')
-rw-r--r--libgfortran/runtime/backtrace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c
index dff4466..943332a 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;
}
}