rocksndiamonds-3.3.1.0
[rocksndiamonds.git] / src / libgame / misc.c
index 4c94b7784985f37b466864f8f8bbe2345fe4106b..60dbcf068c20e9d84a29a6d4de15356d1ce15892 100644 (file)
@@ -1193,7 +1193,8 @@ boolean getFileChunk(FILE *file, char *chunk_name, int *chunk_size,
   const int chunk_name_length = 4;
 
   /* read chunk name */
-  fgets(chunk_name, chunk_name_length + 1, file);
+  if (fgets(chunk_name, chunk_name_length + 1, file) == NULL)
+    return FALSE;
 
   if (chunk_size != NULL)
   {