summaryrefslogtreecommitdiff
path: root/src/init1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:58 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:58 +0100
commit560ebe18ecf165dcfffa2d57870f01f1099be44c (patch)
tree551526f30dfee94d21034e027ef81b675159624e /src/init1.cc
parentcaa23251d8b279529330641032c62f8640ee13ff (diff)
Remove set_head, set_name, set_text
Diffstat (limited to 'src/init1.cc')
-rw-r--r--src/init1.cc38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/init1.cc b/src/init1.cc
index 28f8ba1..d821749 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -5302,7 +5302,7 @@ errr init_set_info_txt(FILE *fp, char *buf)
if (i < error_idx) return (4);
/* Verify information */
- if (i >= set_head->info_num) return (2);
+ if (i >= max_set_idx) return (2);
/* Save the index */
error_idx = i;
@@ -5310,19 +5310,11 @@ errr init_set_info_txt(FILE *fp, char *buf)
/* Point at the "info" */
set_ptr = &set_info[i];
- /* Hack -- Verify space */
- if (set_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7);
-
- /* Advance and Save the name index */
- if (!set_ptr->name) set_ptr->name = ++set_head->name_size;
-
- /* Append chars to the name */
- strcpy(set_name + set_head->name_size, s);
-
- /* Advance the index */
- set_head->name_size += strlen(s);
+ /* Copy name */
+ assert(!set_ptr->name);
+ set_ptr->name = my_strdup(s);
- /* Needed hack */
+ /* Initialize */
set_ptr->num = 0;
set_ptr->num_use = 0;
for (z = 0; z < 6; z++)
@@ -5354,17 +5346,8 @@ errr init_set_info_txt(FILE *fp, char *buf)
/* Acquire the text */
s = buf + 2;
- /* Hack -- Verify space */
- if (set_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7);
-
- /* Advance and Save the text index */
- if (!set_ptr->desc) set_ptr->desc = ++set_head->text_size;
-
- /* Append chars to the name */
- strcpy(set_text + set_head->text_size, s);
-
- /* Advance the index */
- set_head->text_size += strlen(s);
+ /* Append chars to the description */
+ strappend(&set_ptr->desc, s);
/* Next... */
continue;
@@ -5438,16 +5421,9 @@ errr init_set_info_txt(FILE *fp, char *buf)
return (6);
}
-
- /* Complete the "name" and "text" sizes */
- ++set_head->name_size;
- ++set_head->text_size;
-
-
/* No version yet */
if (!okay) return (2);
-
/* Success */
return (0);
}