mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-26 04:30:55 +00:00
Fix mapmusname not overwriting Lua-provided strings
This commit is contained in:
parent
c65851d17c
commit
71caaf180c
1 changed files with 3 additions and 2 deletions
|
@ -441,12 +441,13 @@ int LUA_CheckGlobals(lua_State *L, const char *word)
|
|||
const char *str = luaL_checklstring(L, 2, &strlength);
|
||||
|
||||
if (strlength > 6)
|
||||
return luaL_error(L, "string length out of range (maximum 6 characters)");
|
||||
LUA_UsageWarning(L, "mapmusname: Music name too long - truncated to six characters.");
|
||||
|
||||
if (strlen(str) < strlength)
|
||||
return luaL_error(L, "string must not contain embedded zeros!");
|
||||
|
||||
strncpy(mapmusname, str, strlength);
|
||||
|
||||
strlcpy(mapmusname, str, sizeof mapmusname);
|
||||
}
|
||||
else if (fastcmp(word, "mapmusflags"))
|
||||
mapmusflags = (UINT16)luaL_checkinteger(L, 2);
|
||||
|
|
Loading…
Reference in a new issue