summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
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/runtime
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/runtime')
-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 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;
}
}