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:
parent
941817b915
commit
7137e1fc05
@ -1333,12 +1333,12 @@ int L_StatusMessage(lua_State* L)
|
|||||||
// fill remainder with spaces
|
// fill remainder with spaces
|
||||||
for (;len<24;len++)
|
for (;len<24;len++)
|
||||||
msg2[len]=' ';
|
msg2[len]=' ';
|
||||||
msg2[24]='\0';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strncpy(msg2, msg, 24);
|
strncpy(msg2, msg, 24);
|
||||||
}
|
}
|
||||||
|
msg2[24]='\0';
|
||||||
Print_in_menu(msg2,0);
|
Print_in_menu(msg2,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user