From 6cb352f62658b72af6ab96aaef005f05a6a2c730 Mon Sep 17 00:00:00 2001 From: CaH4e3 Date: Wed, 28 Sep 2011 13:28:21 +0000 Subject: [PATCH] resetexstate crash fix --- src/state.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.cpp b/src/state.cpp index 890c8a3b..411988c6 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -836,7 +836,7 @@ void AddExState(void *v, uint32 s, int type, char *desc) { if(desc) { - SFMDATA[SFEXINDEX].desc=(char *)FCEU_malloc(5); + SFMDATA[SFEXINDEX].desc=(char *)FCEU_malloc(strlen(desc)+1); strcpy(SFMDATA[SFEXINDEX].desc,desc); } else