From: Vsevolod Stakhov Date: Sun, 22 Jan 2023 12:48:37 +0000 (+0000) Subject: [Minor] Check the last split when wrapping X-Git-Tag: 3.5~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aefb2153a88a11cce249f709e10a19ad8d8d39fd;p=thirdparty%2Frspamd.git [Minor] Check the last split when wrapping Reported by: @amishmm --- diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx index c757000dbc..a2bf4c783c 100644 --- a/src/client/rspamc.cxx +++ b/src/client/rspamc.cxx @@ -847,6 +847,10 @@ rspamc_print_indented_line(FILE *out, std::string_view line) -> void suffix = suffix.substr(delim_pos + 1); } else { + /* Check if we can include one last word */ + if (delim_pos == std::string_view::npos && word_len + suffix.size() < split_len) { + word_len += suffix.size(); + } break; } }