mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 04:43:52 +01:00
the bug
This commit is contained in:
@@ -580,7 +580,7 @@ void run_lua(char *str, char *cmd_output) {
|
|||||||
lua_pushstring(L, str);
|
lua_pushstring(L, str);
|
||||||
if (lua_pcall(L, 1, 1, 0) == LUA_OK) {
|
if (lua_pcall(L, 1, 1, 0) == LUA_OK) {
|
||||||
if (lua_isstring(L, -1) && cmd_output) _strncpy(cmd_output, lua_tostring(L, -1), 254);
|
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);
|
} else if (lua_isstring(L, -1) && cmd_output) _strncpy(cmd_output, lua_tostring(L, -1), 254);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
pthread_mutex_unlock(&lua_mutex);
|
pthread_mutex_unlock(&lua_mutex);
|
||||||
@@ -612,7 +612,7 @@ int lua_group(RDSGroup* group) {
|
|||||||
group->c = luaL_checkinteger(L, -2);
|
group->c = luaL_checkinteger(L, -2);
|
||||||
group->b = luaL_checkinteger(L, -3);
|
group->b = luaL_checkinteger(L, -3);
|
||||||
lua_pop(L, 2);
|
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);
|
lua_pop(L, 1);
|
||||||
} else lua_pop(L, 1);
|
} else lua_pop(L, 1);
|
||||||
pthread_mutex_unlock(&lua_mutex);
|
pthread_mutex_unlock(&lua_mutex);
|
||||||
@@ -642,7 +642,7 @@ void lua_group_ref(RDSGroup* group, int ref) {
|
|||||||
group->b = luaL_checkinteger(L, -3);
|
group->b = luaL_checkinteger(L, -3);
|
||||||
lua_pop(L, 3);
|
lua_pop(L, 3);
|
||||||
} else {
|
} 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);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
} else 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_isfunction(L, -1)) {
|
||||||
if (lua_pcall(L, 0, 0, 0) != LUA_OK) {
|
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);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
} else lua_pop(L, 1);
|
} else lua_pop(L, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user