diff options
Diffstat (limited to 'src/comet.c')
| -rw-r--r-- | src/comet.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/comet.c b/src/comet.c index 70c25ff..e8dc5e5 100644 --- a/src/comet.c +++ b/src/comet.c @@ -78,18 +78,10 @@ int main(int argc, char **argv) lua_api_t lua; lua_api_init(&lua); - - char *str = - "function sigma()\n" - " log.info('ssussy')\n" - " log.panic('az')\n" - "end\n" - "sigma()\n"; - - - (void)luaL_dostring(lua.state, "log.info('%d%n%x')"); - (void)luaL_dostring(lua.state, str); - (void)luaL_dofile(lua.state, "example.lua"); + if (luaL_dofile(lua.state, "example.lua") != LUA_OK) { + const char *error_message = lua_tostring(lua.state, -1); + log_error("Lua script failed: %s", error_message); + } const char *config_path = "comet.conf"; FILE *config_file = fopen(config_path, "rb"); |
