Lua plugin: Terminate array with sentinel
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 14 Aug 2016 13:08:40 +0000 (15:08 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 14 Aug 2016 13:08:40 +0000 (15:08 +0200)
From the API docs:
Any array of luaL_Reg must end with a sentinel entry in which both name
and func are NULL.

src/lua.c

index 79f288b..3b8b3da 100644 (file)
--- a/src/lua.c
+++ b/src/lua.c
@@ -370,7 +370,9 @@ static luaL_Reg collectdlib[] = {
     {"log_warning", lua_cb_log_warning},
     {"dispatch_values", lua_cb_dispatch_values},
     {"register_read", lua_cb_register_read},
-    {"register_write", lua_cb_register_write}};
+    {"register_write", lua_cb_register_write},
+    {NULL, NULL}
+};
 
 static int open_collectd(lua_State *L) /* {{{ */
 {