diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index e6b43599..be56bc0b 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -489,7 +489,7 @@ static int savestate_create(lua_State *L) { filename = FCEU_MakeFName(FCEUMKF_STATE, which - 1, 0); } else { - filename = tempnam(NULL, "snlua"); + filename = mkstemp("snlua"); } // Our "object". We don't care about the type, we just need the memory and GC services.