Strings with more than 24 chars were not properly null-terminated before sending them to Print_in_menu, causing random data to appear in the status bar since Print_in_menu will print more chars if there's space.

Thanks to DawnBringer for noticing!

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1899 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2012-01-11 18:29:46 +00:00
parent 941817b915
commit 7137e1fc05

View File

@ -1333,12 +1333,12 @@ int L_StatusMessage(lua_State* L)
// fill remainder with spaces
for (;len<24;len++)
msg2[len]=' ';
msg2[24]='\0';
}
else
{
strncpy(msg2, msg, 24);
}
msg2[24]='\0';
Print_in_menu(msg2,0);
return 0;
}