rnd-20020317-1-src
[rocksndiamonds.git] / src / libgame / misc.c
index 93ba670da6d130f17de807ea1b4fe08348d12f89..f9abe2ad457e6995aceaf0edaa35f877a851e974 100644 (file)
@@ -473,7 +473,8 @@ void GetOptions(char *argv[])
             "  -l, --level directory         alternative level directory\n"
             "  -s, --serveronly              only start network server\n"
             "  -n, --network                 network multiplayer game\n"
-            "  -v, --verbose                 verbose mode\n",
+            "  -v, --verbose                 verbose mode\n"
+            "      --debug                   display debugging information\n",
             program.command_basename);
       exit(0);
     }
@@ -708,8 +709,11 @@ boolean getFileChunk(FILE *file, char *chunk_name, int *chunk_size,
   /* read chunk name */
   fgets(chunk_name, chunk_name_length + 1, file);
 
-  /* read chunk size */
-  *chunk_size = getFile32BitInteger(file, byte_order);
+  if (chunk_size != NULL)
+  {
+    /* read chunk size */
+    *chunk_size = getFile32BitInteger(file, byte_order);
+  }
 
   return (feof(file) || ferror(file) ? FALSE : TRUE);
 }
@@ -720,8 +724,11 @@ void putFileChunk(FILE *file, char *chunk_name, int chunk_size,
   /* write chunk name */
   fputs(chunk_name, file);
 
-  /* write chunk size */
-  putFile32BitInteger(file, chunk_size, byte_order);
+  if (chunk_size >= 0)
+  {
+    /* write chunk size */
+    putFile32BitInteger(file, chunk_size, byte_order);
+  }
 }
 
 #define TRANSLATE_KEYSYM_TO_KEYNAME    0