]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] More things to fix
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 18 Nov 2024 17:30:51 +0000 (17:30 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 18 Nov 2024 17:30:51 +0000 (17:30 +0000)
src/libmime/mime_headers.c

index a511f5e36b526e3c9853643d20219def50546e96..f33311bbfc43cf7341c27ebcbf23a52350adffd1 100644 (file)
@@ -854,13 +854,6 @@ rspamd_mime_header_encode(const char *in, gsize len, bool is_structured)
                                else {
                                        encoded_len++;
 
-                                       if (!need_encoding) {
-                                               unencoded_prefix++;
-                                       }
-                                       else {
-                                               unencoded_suffix++;
-                                       }
-
                                        if (encoded_len > max_token_size) {
                                                piece_len = i;
                                                q = p + piece_len;
@@ -875,6 +868,13 @@ rspamd_mime_header_encode(const char *in, gsize len, bool is_structured)
                                                /* No more space */
                                                break;
                                        }
+
+                                       if (!need_encoding) {
+                                               unencoded_prefix++;
+                                       }
+                                       else {
+                                               unencoded_suffix++;
+                                       }
                                }
                        }