summaryrefslogtreecommitdiff
path: root/src/plugins/relay/api/relay-api-msg.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-05-05 17:49:20 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-05-05 17:49:20 +0200
commit9ceea3697bf5f194d4a86e46dd9b04012dc0592c (patch)
tree2106ab68b8f3a229bd7f22bcb2c372694d0b4399 /src/plugins/relay/api/relay-api-msg.c
parent0cf504dce70c5d804715fd6946476c5a17950d96 (diff)
downloadweechat-9ceea3697bf5f194d4a86e46dd9b04012dc0592c.zip
relay/api: fix read of buffer lines when lines parameter is LONG_MIN
Diffstat (limited to 'src/plugins/relay/api/relay-api-msg.c')
-rw-r--r--src/plugins/relay/api/relay-api-msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/relay/api/relay-api-msg.c b/src/plugins/relay/api/relay-api-msg.c
index 9ef294dae..d02868301 100644
--- a/src/plugins/relay/api/relay-api-msg.c
+++ b/src/plugins/relay/api/relay-api-msg.c
@@ -560,7 +560,7 @@ relay_api_msg_lines_to_json (struct t_gui_buffer *buffer,
ptr_line = weechat_hdata_pointer (relay_hdata_lines, ptr_lines, "last_line");
if (ptr_line)
{
- for (i = 1; i < lines * -1; i++)
+ for (i = -1; i > lines; i--)
{
ptr_line = weechat_hdata_move (relay_hdata_line, ptr_line, -1);
if (!ptr_line)