OSDN Git Service

PR 49214 fd_gets should return NULL if nothing was read
[pf3gnuchains/gcc-fork.git] / libgfortran / runtime / backtrace.c
index dff4466..943332a 100644 (file)
@@ -95,6 +95,8 @@ fd_gets (char *s, int size, int fd)
       else
        {
          s[i] = '\0';
+         if (i == 0)
+           return NULL;
          break;
        }
     }