summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-hook.c1
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c2
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c2
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c2
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c2
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl-api.c2
6 files changed, 11 insertions, 0 deletions
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index d834cd58f..68f82a823 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -1052,6 +1052,7 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
&& (!HOOK_PRINT(ptr_hook, buffer)
|| (buffer == HOOK_PRINT(ptr_hook, buffer)))
&& (!HOOK_PRINT(ptr_hook, message)
+ || !HOOK_PRINT(ptr_hook, message)[0]
|| string_strcasestr (prefix_no_color, HOOK_PRINT(ptr_hook, message))
|| string_strcasestr (message_no_color, HOOK_PRINT(ptr_hook, message))))
{
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 82edef379..95d0eaefa 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -2830,6 +2830,8 @@ weechat_lua_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
lua_argv[0] = script_ptr2str (buffer);
lua_argv[1] = timebuffer;
lua_argv[2] = weechat_string_build_with_exploded (tags, ",");
+ if (!lua_argv[2])
+ lua_argv[2] = strdup ("");
lua_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
lua_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
lua_argv[5] = (char *)prefix;
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index b953b0b3b..e3e6a8123 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -2362,6 +2362,8 @@ weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
perl_argv[0] = script_ptr2str (buffer);
perl_argv[1] = timebuffer;
perl_argv[2] = weechat_string_build_with_exploded (tags, ",");
+ if (!perl_argv[2])
+ perl_argv[2] = strdup ("");
perl_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
perl_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
perl_argv[5] = (char *)prefix;
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index f6253f087..06459fb84 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -2522,6 +2522,8 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
python_argv[0] = script_ptr2str (buffer);
python_argv[1] = timebuffer;
python_argv[2] = weechat_string_build_with_exploded (tags, ",");
+ if (!python_argv[2])
+ python_argv[2] = strdup ("");
python_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
python_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
python_argv[5] = (char *)prefix;
diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c
index 8e3f0e5d5..8dc690f7e 100644
--- a/src/plugins/scripts/ruby/weechat-ruby-api.c
+++ b/src/plugins/scripts/ruby/weechat-ruby-api.c
@@ -2905,6 +2905,8 @@ weechat_ruby_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
ruby_argv[0] = script_ptr2str (buffer);
ruby_argv[1] = timebuffer;
ruby_argv[2] = weechat_string_build_with_exploded (tags, ",");
+ if (!ruby_argv[2])
+ ruby_argv[2] = strdup ("");
ruby_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
ruby_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
ruby_argv[5] = (char *)prefix;
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c
index 4e51e24d1..fd6d83496 100644
--- a/src/plugins/scripts/tcl/weechat-tcl-api.c
+++ b/src/plugins/scripts/tcl/weechat-tcl-api.c
@@ -2734,6 +2734,8 @@ weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
tcl_argv[0] = script_ptr2str (buffer);
tcl_argv[1] = timebuffer;
tcl_argv[2] = weechat_string_build_with_exploded (tags, ",");
+ if (!tcl_argv[2])
+ tcl_argv[2] = strdup ("");
tcl_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
tcl_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
tcl_argv[5] = (char *)prefix;