From e840a8f96cc34f3de1f0f1540a01251908474e5e Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Mon, 20 Dec 2010 19:08:29 +0100 Subject: [PATCH] Another embedded zero issue in threads (isue #128) --- src/modules/thread/sdl/wrap_Thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/thread/sdl/wrap_Thread.cpp b/src/modules/thread/sdl/wrap_Thread.cpp index 2553907c0..0d8f6299d 100644 --- a/src/modules/thread/sdl/wrap_Thread.cpp +++ b/src/modules/thread/sdl/wrap_Thread.cpp @@ -257,7 +257,10 @@ namespace sdl int w_newThread(lua_State *L) { - std::string name = luaL_checkstring(L, 1); + luaL_checkstring(L, 1); + size_t len; + const char *name_str = lua_tolstring(L, 1, &len); + std::string name(name_str, len); love::Data *data; if (lua_isstring(L, 2)) luax_convobj(L, 2, "filesystem", "newFile");