From 91147a80e08296f0a3e9551a6464e334a1d5de89 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 13 Aug 2008 04:21:08 +0000 Subject: [PATCH] [ 2047645 ] Creating a savestate object in Lua crashes FCEUX --- src/lua-engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index d33a5642..640117bf 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -489,7 +489,8 @@ static int savestate_create(lua_State *L) { filename = FCEU_MakeFName(FCEUMKF_STATE, which - 1, 0); } else { - filename = mktemp("snlua"); + char tempbuf[100] = "snluaXXXXXX"; + filename = mktemp(tempbuf); } // Our "object". We don't care about the type, we just need the memory and GC services.