diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-03-11 21:11:54 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-03-11 21:11:54 +0100 |
commit | 9543f9c03494a9ced1dd0d5529c43b931e7d9d0a (patch) | |
tree | 64e8f2714715d79307106eaa4da5f34e8505f95a /src/core | |
parent | d5e1a52e24a9a43492820a196074884bea8a24cd (diff) | |
download | weechat-9543f9c03494a9ced1dd0d5529c43b931e7d9d0a.zip |
core: add missing \0 at the end of stderr buffer in hook_process
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-hook.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index 415879530..0334464f3 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -1607,15 +1607,15 @@ hook_process_child (struct t_hook *hook_process) void hook_process_send_buffers (struct t_hook *hook_process, int callback_rc) { - int i, size; + int size; /* add '\0' at end of stdout and stderr */ - for (i = 0; i < 2; i++) - { - size = HOOK_PROCESS(hook_process, buffer_size[i]); - if (size > 0) - HOOK_PROCESS(hook_process, buffer[i])[size] = '\0'; - } + size = HOOK_PROCESS(hook_process, buffer_size[HOOK_PROCESS_STDOUT]); + if (size > 0) + HOOK_PROCESS(hook_process, buffer[HOOK_PROCESS_STDOUT])[size] = '\0'; + size = HOOK_PROCESS(hook_process, buffer_size[HOOK_PROCESS_STDERR]); + if (size > 0) + HOOK_PROCESS(hook_process, buffer[HOOK_PROCESS_STDERR])[size] = '\0'; /* send buffers to callback */ (void) (HOOK_PROCESS(hook_process, callback)) |