Ver código fonte

Fixed compiler warning on newer Linux systems.
(transplanted from 3ab4702d6313b2590f202f1475cd68976765f02f)

Ryan C. Gordon 16 anos atrás
pai
commit
7aaa4dc6bf
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      test/test_physfs.c

+ 3 - 1
test/test_physfs.c

@@ -1116,7 +1116,9 @@ static void open_history_file(void)
 
         do
         {
-            fgets(buf, sizeof (buf), f);
+            if (fgets(buf, sizeof (buf), f) == NULL)
+                break;
+
             if (buf[strlen(buf) - 1] == '\n')
                 buf[strlen(buf) - 1] = '\0';
             add_history(buf);