From 92ff8019cfa9d5ec4cd825cc0ca944b277fe80b0 Mon Sep 17 00:00:00 2001 From: Fate Date: Fri, 15 May 2009 23:20:27 +0000 Subject: builtin_menu: allocate memory for terminator byte --- src/map/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map/script.c') 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); -- cgit v1.2.3-60-g2f50