summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/ruby/weechat-ruby-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-11-29 23:31:28 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-11-29 23:31:28 +0100
commit265a0cf2a1dc625dd412c724262be07e31214b37 (patch)
tree7a4fcd22fde672c0e1bf5b9a234d30b58ef3f74b /src/plugins/scripts/ruby/weechat-ruby-api.c
parent003bc0451e76720a6740c12720d2302cb4647ade (diff)
downloadweechat-265a0cf2a1dc625dd412c724262be07e31214b37.zip
Fix bugs with hook_print function in scripts
Diffstat (limited to 'src/plugins/scripts/ruby/weechat-ruby-api.c')
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c2
1 files changed, 2 insertions, 0 deletions
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;