aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-10-24 23:04:05 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-10-24 23:04:05 -0400
commit1de8c1bb596a7dbff39ab55685ead31a5d0c9373 (patch)
treece475e981b6134964c1d27506d24842a67fa059b /src/textadept.c
parentb2436878d123496fb6dc1e8008730af8302f8c6b (diff)
downloadtextadept-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.c4
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) {