1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 23:36:37 +02:00

core: add missing \0 at the end of stderr buffer in hook_process

This commit is contained in:
Sebastien Helleu
2014-03-11 21:11:54 +01:00
parent d5e1a52e24
commit 9543f9c034
2 changed files with 8 additions and 7 deletions
+1
View File
@@ -15,6 +15,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
* core: add missing \0 at the end of stderr buffer in hook_process
* core: fix detection of terminated process in hook_process
* core: set option weechat.look.buffer_search_where to prefix_message by default
* core: fix "/window scroll -N" on a buffer with free content
+7 -7
View File
@@ -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))