From 8e89f38f28fd5c7dff91732807a591eaefbc36c0 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 23 Feb 2015 09:11:58 +0100 Subject: Remove re_head, re_name --- src/init1.cc | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'src/init1.cc') diff --git a/src/init1.cc b/src/init1.cc index 66ea59ab..ad1cda4c 100644 --- a/src/init1.cc +++ b/src/init1.cc @@ -8046,11 +8046,6 @@ errr init_re_info_txt(FILE *fp, char *buf) /* Just before the first line */ error_line = -1; - - /* Start the "fake" stuff */ - re_head->name_size = 0; - re_head->text_size = 0; - /* Parse */ fp_stack_init(fp); while (0 == my_fgets_dostack(buf, 1024)) @@ -8112,7 +8107,7 @@ errr init_re_info_txt(FILE *fp, char *buf) if (i < error_idx) return (4); /* Verify information */ - if (i >= re_head->info_num) return (2); + if (i >= max_re_idx) return (2); /* Save the index */ error_idx = i; @@ -8120,17 +8115,9 @@ errr init_re_info_txt(FILE *fp, char *buf) /* Point at the "info" */ re_ptr = &re_info[i]; - /* Hack -- Verify space */ - if (re_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); - - /* Advance and Save the name index */ - if (!re_ptr->name) re_ptr->name = ++re_head->name_size; - - /* Append chars to the name */ - strcpy(re_name + re_head->name_size, s); - - /* Advance the index */ - re_head->name_size += strlen(s); + /* Copy name */ + assert(!re_ptr->name); + re_ptr->name = my_strdup(s); /* Some inits */ blow_num = 0; @@ -8529,10 +8516,6 @@ errr init_re_info_txt(FILE *fp, char *buf) return (6); } - - /* Complete the "name" and "text" sizes */ - ++re_head->name_size; - /* No version yet */ if (!okay) return (2); -- cgit v1.2.3