1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 02:19:04 +00:00

Add a tostring metamethod for bignum objects. See #1876

This commit is contained in:
dmiller
2020-01-03 16:54:59 +00:00
parent 0f3a8a7e0d
commit f8846c2c39

View File

@@ -650,6 +650,9 @@ LUALIB_API int luaopen_openssl(lua_State *L) {
// metatable.__index = metatable
lua_pushvalue( L, -1 );
lua_setfield( L, -2, "__index" );
// metatable.__tostring = bignum_bn2hex
lua_pushcfunction( L, l_bignum_bn2hex );
lua_setfield( L, -2, "__tostring" );
// register methods
luaL_setfuncs(L, bignum_methods, 0);