util-src/*.c: Don't create globals when loaded
[prosody.git] / util-src / hashes.c
index 33041e83bdb8929f3673d860a408a3e89b22c064..7ca00867d7f6c81b1417587703c5032644e64691 100644 (file)
@@ -203,7 +203,8 @@ static const luaL_Reg Reg[] =
 
 LUALIB_API int luaopen_util_hashes(lua_State *L)
 {
-       luaL_register(L, "hashes", Reg);
+       lua_newtable(L);
+       luaL_register(L, NULL, Reg);
        lua_pushliteral(L, "version");                  /** version */
        lua_pushliteral(L, "-3.14");
        lua_settable(L,-3);