mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 12:26:40 +02:00
api: send file descriptor as integer instead of string to the callback of hook_fd
This commit is contained in:
@@ -2121,7 +2121,7 @@ weechat_js_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;
|
||||
|
||||
@@ -2130,15 +2130,13 @@ weechat_js_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_js_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user