Use lua_pushlstring() so strings with embedded NULs also work

This commit is contained in:
Niels Martin Hansen 2014-04-24 23:49:36 +02:00
parent 18f55eaebf
commit 3f08b1d057
1 changed files with 3 additions and 2 deletions

View File

@ -40,11 +40,12 @@ inline void push_value(lua_State *L, wxString const& value) {
}
inline void push_value(lua_State *L, agi::fs::path const& value) {
lua_pushstring(L, value.string().c_str());
std::string strval = value.string();
lua_pushlstring(L, strval.c_str(), strval.size());
}
inline void push_value(lua_State *L, std::string const& value) {
lua_pushstring(L, value.c_str());
lua_pushlstring(L, value.c_str(), value.size());
}
inline void push_value(lua_State *L, lua_CFunction value) {