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:
@@ -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
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user