aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@25thandClement.com> 2016-01-08 13:10:27 +0800
committerLibravatarLibravatar William Ahern <william@25thandClement.com> 2016-01-08 13:10:27 +0800
commit49d0192120c6e3485efd10725ea851b538222e6b (patch)
tree0ed5f00e83f6f9a1f8cd29459653bbbc106c01b3 /src
parentfbc2058139566d2530d72ec5e77daf9847ffe252 (diff)
downloadluaossl-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.c2
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");