summaryrefslogtreecommitdiff
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-08-13 09:29:39 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-08-13 09:29:39 +0200
commit5392e3078f454103c0606bb990ad8acffd7a4ae1 (patch)
treee82341d5a4037d1886874703bdb32de831d67683 /src/plugins/lua
parent2b7ea69d00526c0f94c20bf670da86344437e0d5 (diff)
downloadweechat-5392e3078f454103c0606bb990ad8acffd7a4ae1.zip
api: send file descriptor as integer instead of string to the callback of hook_fd
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/weechat-lua-api.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index a8d07e5bd..9148bfb2c 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -2316,7 +2316,7 @@ weechat_lua_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_fd[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
@@ -2325,15 +2325,13 @@ weechat_lua_api_hook_fd_cb (const void *pointer, void *data, int fd)
if (ptr_function && ptr_function[0])
{
- snprintf (str_fd, sizeof (str_fd), "%d", fd);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_fd;
+ func_argv[1] = &fd;
rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;