summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-05-15 23:20:27 +0000
committerFate <fate-tmw@googlemail.com>2009-05-15 23:20:27 +0000
commit92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0 (patch)
treeba7358986af3e292611722b3d81db05804766578 /src/map/script.c
parent4e7a458308e2c3c6670489da43d06bd25c2db92c (diff)
downloadtmwa-92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0.tar.gz
tmwa-92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0.tar.bz2
tmwa-92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0.tar.xz
tmwa-92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0.zip
builtin_menu: allocate memory for terminator byte
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index daf6374..a0ab3e0 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -1652,7 +1652,7 @@ int buildin_menu(struct script_state *st)
st->state=RERUNLINE;
sd->state.menu_or_input=1;
- buf=(char *)aCalloc(len,sizeof(char));
+ buf=(char *)aCalloc(len + 1, sizeof(char));
buf[0]=0;
for(i=st->start+2; menu_choices > 0; i+=2, --menu_choices){
strcat(buf,st->stack->stack_data[i].u.str);