lm_ssl.c
changeset 54 6bef2082e5f9
parent 42 61d0ab29f17f
child 57 37ed3c7ac1b6
--- a/lm_ssl.c	Wed Nov 28 01:55:12 2012 +0200
+++ b/lm_ssl.c	Wed Nov 28 01:56:15 2012 +0200
@@ -95,7 +95,7 @@
 		gchar buffer[16] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
 		const char *fingerprint = luaL_checkstring (L, 1);
 
-		if (lua_objlen (L, 1) > 46)
+		if (lua_rawlen (L, 1) > 46)
 			string2fingerprint (fingerprint, buffer);
 		ssl = lm_ssl_new (buffer, NULL, NULL, NULL);
 	} else {
@@ -104,7 +104,7 @@
 
 		if (args > 1) {
 			const char *fingerprint = luaL_checkstring (L, 1);
-			if (lua_objlen (L, 1) > 46)
+			if (lua_rawlen (L, 1) > 46)
 				string2fingerprint (fingerprint, buffer);
 			luaL_argcheck (L, lua_isfunction (L, 2), 2, "function expected");
 		} else
@@ -224,10 +224,10 @@
 	luaL_newmetatable (L, "loudmouth.ssl");
 	lua_pushvalue (L, -1);
 	lua_setfield (L, -2, "__index");
-	luaL_register (L, NULL, reg_m_lm_ssl);
+	luaL_setfuncs (L, reg_m_lm_ssl, 0);
 	lua_pop (L, 1);
 	lua_newtable (L); // XXX we can specify here exact amount of fields
-	luaL_register (L, NULL, reg_f_lm_ssl);
+	luaL_setfuncs (L, reg_f_lm_ssl, 0);
 	return 1;
 }