diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-08-23 23:27:57 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-08-23 23:27:57 +0200 |
commit | cfd221014c1e5337ec14503430c98ca620024f81 (patch) | |
tree | dab43957d533958230c6bf8471c86526825bf47f /src/plugins/lua/weechat-lua.c | |
parent | b459dab84bcc2fa30634c083c931797e3ca6f4f6 (diff) | |
download | weechat-cfd221014c1e5337ec14503430c98ca620024f81.zip |
api: add argument "bytes" in function string_dyn_concat
Diffstat (limited to 'src/plugins/lua/weechat-lua.c')
-rw-r--r-- | src/plugins/lua/weechat-lua.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index df03dc4e5..30c042ac8 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -258,7 +258,6 @@ int weechat_lua_output (lua_State *L) { const char *msg, *ptr_msg, *ptr_newline; - char *message; if (lua_gettop (L) < 1) return 0; @@ -267,14 +266,13 @@ weechat_lua_output (lua_State *L) ptr_msg = msg; while ((ptr_newline = strchr (ptr_msg, '\n')) != NULL) { - message = weechat_strndup (ptr_msg, ptr_newline - ptr_msg); - weechat_string_dyn_concat (lua_buffer_output, message); - if (message) - free (message); + weechat_string_dyn_concat (lua_buffer_output, + ptr_msg, + ptr_newline - ptr_msg); weechat_lua_output_flush (); ptr_msg = ++ptr_newline; } - weechat_string_dyn_concat (lua_buffer_output, ptr_msg); + weechat_string_dyn_concat (lua_buffer_output, ptr_msg, -1); return 0; } |