0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00
This commit is contained in:
2025-12-24 22:44:58 +01:00
parent f10ca8a5a7
commit 099dbca12d

View File

@@ -580,7 +580,7 @@ void run_lua(char *str, char *cmd_output) {
lua_pushstring(L, str);
if (lua_pcall(L, 1, 1, 0) == LUA_OK) {
if (lua_isstring(L, -1) && cmd_output) _strncpy(cmd_output, lua_tostring(L, -1), 254);
} else fprintf(stderr, "Lua error: %s\n", lua_tostring(L, -1));
} else fprintf(stderr, "Lua error: %s\n at 'data_handle'", lua_tostring(L, -1));
} else if (lua_isstring(L, -1) && cmd_output) _strncpy(cmd_output, lua_tostring(L, -1), 254);
lua_pop(L, 1);
pthread_mutex_unlock(&lua_mutex);
@@ -612,7 +612,7 @@ int lua_group(RDSGroup* group) {
group->c = luaL_checkinteger(L, -2);
group->b = luaL_checkinteger(L, -3);
lua_pop(L, 2);
} else fprintf(stderr, "Lua error: %s\n", lua_tostring(L, -1));
} else fprintf(stderr, "Lua error: %s at 'group'\n", lua_tostring(L, -1));
lua_pop(L, 1);
} else lua_pop(L, 1);
pthread_mutex_unlock(&lua_mutex);
@@ -642,7 +642,7 @@ void lua_group_ref(RDSGroup* group, int ref) {
group->b = luaL_checkinteger(L, -3);
lua_pop(L, 3);
} else {
fprintf(stderr, "Lua error: %s\n", lua_tostring(L, -1));
fprintf(stderr, "Lua error: %s\n at ref %d", lua_tostring(L, -1), ref);
lua_pop(L, 1);
}
} else lua_pop(L, 1);
@@ -655,7 +655,7 @@ void lua_call_function(const char* function) {
if (lua_isfunction(L, -1)) {
if (lua_pcall(L, 0, 0, 0) != LUA_OK) {
fprintf(stderr, "Lua error: %s\n", lua_tostring(L, -1));
fprintf(stderr, "Lua error: %s at '%s'\n", lua_tostring(L, -1), function);
lua_pop(L, 1);
}
} else lua_pop(L, 1);