Lua: fix emu.message() not to overwrite the display string by other Lua functions.

This commit is contained in:
gocha 2012-08-15 11:21:18 +09:00
parent ee99d9080f
commit 3f788a3d3e
1 changed files with 6 additions and 1 deletions

View File

@ -1062,7 +1062,12 @@ DEFINE_LUA_FUNCTION(print, "...")
DEFINE_LUA_FUNCTION(emu_message, "str")
{
const char* str = toCString(L);
S9xSetInfoString(str);
static char msg[1024];
strncpy(msg, str, 1024);
msg[1024] = '\0';
S9xSetInfoString(msg);
return 0;
}