From 9ceea3697bf5f194d4a86e46dd9b04012dc0592c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 5 May 2024 17:49:20 +0200 Subject: [PATCH] relay/api: fix read of buffer lines when lines parameter is LONG_MIN --- src/plugins/relay/api/relay-api-msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)