diff options
author | William Ahern <william@25thandClement.com> | 2016-01-08 13:10:27 +0800 |
---|---|---|
committer | William Ahern <william@25thandClement.com> | 2016-01-08 13:10:27 +0800 |
commit | 49d0192120c6e3485efd10725ea851b538222e6b (patch) | |
tree | 0ed5f00e83f6f9a1f8cd29459653bbbc106c01b3 /src | |
parent | fbc2058139566d2530d72ec5e77daf9847ffe252 (diff) | |
download | luaossl-49d0192120c6e3485efd10725ea851b538222e6b.tar.gz luaossl-49d0192120c6e3485efd10725ea851b538222e6b.tar.bz2 luaossl-49d0192120c6e3485efd10725ea851b538222e6b.zip |
try to avoid negative stack indices with luaL_checkstring as error messages are confusing (per daurnimator)
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c index c777e14..4eba534 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -289,7 +289,7 @@ static int auxL_swapmetatable(lua_State *, const char *); static int auxL_swapmetasubtable(lua_State *, const char *, const char *); static int interpose(lua_State *L, const char *mt) { - if (!strncmp("__", luaL_checkstring(L, -2), 2)) { + if (!strncmp("__", luaL_checkstring(L, lua_absindex(L, -2)), 2)) { return auxL_swapmetatable(L, mt); } else { return auxL_swapmetasubtable(L, mt, "__index"); |