1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

make arguments for function get_buffer_data() mandatory in plugins/scripts

This commit is contained in:
Emmanuel Bouthenot
2007-03-09 15:46:08 +00:00
parent cfd2f57dd1
commit 063744ef7d
8 changed files with 54 additions and 64 deletions
+5 -13
View File
@@ -2115,26 +2115,18 @@ weechat_lua_get_buffer_data (lua_State *L)
channel = NULL;
n = lua_gettop (lua_current_interpreter);
switch (n)
if (n != 2)
{
case 0:
break;
case 1:
server = lua_tostring (lua_current_interpreter, -1);
break;
case 2:
server = lua_tostring (lua_current_interpreter, -2);
channel = lua_tostring (lua_current_interpreter, -1);
break;
default:
lua_plugin->print_server (lua_plugin,
"Lua error: wrong parameters for "
"\"get_buffer_data\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
server = lua_tostring (lua_current_interpreter, -2);
channel = lua_tostring (lua_current_interpreter, -1);
buffer_data = lua_plugin->get_buffer_data (lua_plugin, (char *) server, (char *) channel);
if (!buffer_data)
{