diff --git a/src/lua_script.c b/src/lua_script.c
index a36e5bf985e477a4ebc188c622ab02ac7b260d4f..44fcbe60166dd37f7d980497705336b5267ccf56 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -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);