summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-29 13:17:17 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-29 13:17:17 +0000
commit467fa2ada0cbc1b7b81db7567540e8e46dbca920 (patch)
treebb8ede82e2230ffdeb4ede2295decf8c03b48c5c /libgfortran
parent34c4d8ed1d740eabb18a7d755bd302a4f5448aaa (diff)
downloadgcc-467fa2ada0cbc1b7b81db7567540e8e46dbca920.tar.gz
PR 49214 fd_gets should return NULL if nothing was read
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174395 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/runtime/backtrace.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 1d08da8c3b9..f0e3078e8b3 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,10 @@
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
* io/read.c (convert_real): Check for invalid input by comparing
endptr instead of EINVAL.
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;
}
}