From bcd41dc1aafcbfc12803e5326f80ee0b5ebf7fdf Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 7 Jan 2014 15:55:23 +0100 Subject: LuaState can push strings with embedded NULs. This also marginally improves performance, since a strlen() isn't called (inside lua_pushstring()), the string length is stored in the AString object directly. --- src/Bindings/LuaState.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index a684620f3..83351591c 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -297,7 +297,7 @@ void cLuaState::Push(const AString & a_String) { ASSERT(IsValid()); - tolua_pushcppstring(m_LuaState, a_String); + lua_pushlstring(m_LuaState, a_String.data(), a_String.size()); m_NumCurrentFunctionArgs += 1; } -- cgit v1.2.3