diff options
author | 2014-10-24 23:04:05 -0400 | |
---|---|---|
committer | 2014-10-24 23:04:05 -0400 | |
commit | 1de8c1bb596a7dbff39ab55685ead31a5d0c9373 (patch) | |
tree | ce475e981b6134964c1d27506d24842a67fa059b /src/textadept.c | |
parent | b2436878d123496fb6dc1e8008730af8302f8c6b (diff) | |
download | textadept-1de8c1bb596a7dbff39ab55685ead31a5d0c9373.tar.gz textadept-1de8c1bb596a7dbff39ab55685ead31a5d0c9373.zip |
Fixed bug in `lL_event()` for LUA_TNUMBER type size mismatches; src/textadept.c
The type extracted for LUA_TNUMBER was `sptr_t` (long), however most of the
time, `int` is used. Since `sizeof(long) > sizeof(int)`, `lL_event()` sometimes
pushed extra bytes in memory around the original integer passed (at least I
think this explains the behavior I observed).
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/textadept.c b/src/textadept.c index a2073525..b5fe7b55 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -239,9 +239,9 @@ static int lL_event(lua_State *L, const char *name, ...) { if (type == LUA_TNIL) lua_pushnil(L); else if (type == LUA_TBOOLEAN) - lua_pushboolean(L, va_arg(ap, sptr_t)); + lua_pushboolean(L, va_arg(ap, int)); else if (type == LUA_TNUMBER) - lua_pushinteger(L, va_arg(ap, sptr_t)); + lua_pushinteger(L, va_arg(ap, int)); else if (type == LUA_TSTRING) lua_pushstring(L, va_arg(ap, char *)); else if (type == LUA_TLIGHTUSERDATA || type == LUA_TTABLE) { |