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 | |
| 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)
| -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 *); | |||
| 289 | static int auxL_swapmetasubtable(lua_State *, const char *, const char *); | 289 | static int auxL_swapmetasubtable(lua_State *, const char *, const char *); |
| 290 | 290 | ||
| 291 | static int interpose(lua_State *L, const char *mt) { | 291 | static int interpose(lua_State *L, const char *mt) { |
| 292 | if (!strncmp("__", luaL_checkstring(L, -2), 2)) { | 292 | if (!strncmp("__", luaL_checkstring(L, lua_absindex(L, -2)), 2)) { |
| 293 | return auxL_swapmetatable(L, mt); | 293 | return auxL_swapmetatable(L, mt); |
| 294 | } else { | 294 | } else { |
| 295 | return auxL_swapmetasubtable(L, mt, "__index"); | 295 | return auxL_swapmetasubtable(L, mt, "__index"); |
