home · contact · privacy
Moved textfile_sizes() to readwrite library.
[plomrogue] / src / map_objects.c
index 8b84ac136fcd5a07589ebf591b92227fbed805d1..2edb31d43464b071e5bc7be43fa773ee0754d821 100644 (file)
@@ -5,8 +5,10 @@
 #include <stdint.h> /* for uint8_t */
 #include <stdio.h> /* for FILE typedef */
 #include <string.h> /* for strchr(), strlen(), memcpy(), strtok() */
-#include "readwrite.h" /* for [read/write]_uint[8/16/23][_bigendian]() */
-#include "misc.h" /* for textfile_sizes(), find_passable_pos() */
+#include "readwrite.h" /* for textfile_sizes(),
+                        * [read/write]_uint[8/16/23][_bigendian]()
+                        */
+#include "misc.h" /* for find_passable_pos() */
 #include "main.h" /* for World struct */
 #include "rexit.h" /* for err_exit() */
 
@@ -107,10 +109,10 @@ extern void init_map_object_defs(struct World * world, char * filename)
     world->monster_def = 0;
     struct ItemDef    * * p_p_id  = &world->item_def;
     struct MonsterDef * * p_p_md  = &world->monster_def;
-    char defline[linemax];
+    char defline[linemax + 1];
     char * line_p;
     char * delim = " ";
-    while (fgets(defline, linemax, file))
+    while (fgets(defline, linemax + 1, file))
     {
         mod.next    = 0;
         mod.id      = atoi(strtok(defline, delim));