summaryrefslogtreecommitdiff
path: root/src/init1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:57 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:57 +0100
commit7357dd5d299d7937ce62b486dda375b3b0eadb49 (patch)
treecd795bd88370abdd0410694590d1e609af8b639e /src/init1.cc
parentdfcb08c2e7c2e6713691b3003e51295f05e75f5a (diff)
Make sure {k_ptr,r_ptr}*->text is initialized to empty string
This is simpler to make robust, so we'll opt for just doing this at initialization time.
Diffstat (limited to 'src/init1.cc')
-rw-r--r--src/init1.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/init1.cc b/src/init1.cc
index b01072a..402618e 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -4243,6 +4243,9 @@ errr init_k_info_txt(FILE *fp, char *buf)
assert(!k_ptr->name);
k_ptr->name = my_strdup(s);
+ /* Ensure empty description */
+ k_ptr->text = my_strdup("");
+
/* Needed hack */
k_ptr->esp = 0;
k_ptr->power = -1;
@@ -7564,6 +7567,9 @@ errr init_r_info_txt(FILE *fp, char *buf)
assert(!r_ptr->name); // Sanity check that we aren't overwriting anything
r_ptr->name = my_strdup(s);
+ /* Ensure empty description */
+ r_ptr->text = my_strdup("");
+
/* HACK -- Those ones HAVE to have a set default value */
r_ptr->drops.treasure = OBJ_GENE_TREASURE;
r_ptr->drops.combat = OBJ_GENE_COMBAT;