From 51fa76a3b307fb8ddaf2e086723489d1b2d2655d Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 27 May 2016 13:59:38 +0000 Subject: MirLua: fix MT::Set method git-svn-id: http://svn.miranda-ng.org/main/trunk@16875 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_protocols.cpp | 2 +- plugins/MirLua/src/mlua_metatable.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/MirLua/src') diff --git a/plugins/MirLua/src/m_protocols.cpp b/plugins/MirLua/src/m_protocols.cpp index 5bcc6a829d..dd3db59833 100644 --- a/plugins/MirLua/src/m_protocols.cpp +++ b/plugins/MirLua/src/m_protocols.cpp @@ -99,7 +99,7 @@ static int lua_AccountIterator(lua_State *L) { int i = lua_tointeger(L, lua_upvalueindex(1)); int count = lua_tointeger(L, lua_upvalueindex(2)); - PROTOACCOUNT** accounts = (PROTOACCOUNT**)lua_touserdata(L, lua_upvalueindex(3)); + PROTOACCOUNT **accounts = (PROTOACCOUNT**)lua_touserdata(L, lua_upvalueindex(3)); if (i < count) { diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index 6e8ddc3cf5..deb4c66cef 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -193,8 +193,8 @@ public: return; } - T *udata = (T*)lua_newuserdata(L, sizeof(T)); - memcpy(udata, obj, sizeof(T)); + T **udata = (T**)lua_newuserdata(L, sizeof(T)); + *udata = obj; luaL_setmetatable(L, MT::name); } }; -- cgit v1.2.3