]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Check the last split when wrapping
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 22 Jan 2023 12:48:37 +0000 (12:48 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 22 Jan 2023 12:48:37 +0000 (12:48 +0000)
Reported by: @amishmm

src/client/rspamc.cxx

index c757000dbc1630c8dc7c28310257b8870e59bb30..a2bf4c783c0bec14bb9752eb4a244a944272b6c3 100644 (file)
@@ -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;
                        }
                }