Explorar el Código

Fixed compiler warning on newer Linux systems.

Ryan C. Gordon hace 16 años
padre
commit
5720b168ca
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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);