]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - debian/patches/fix_header_char_cast
b43e9d3a0e4121a75164d324597bf1861871675e
[deb_pkgs/spamass-milter.git] / debian / patches / fix_header_char_cast
1 Description: Fix a const cast in the header
2 Author: Don Armstrong <don@donarmstrong.com>
3 Forwarded: no
4 Index: spamass-milter/spamass-milter.cpp
5 ===================================================================
6 --- spamass-milter.orig/spamass-milter.cpp      2012-06-21 13:02:08.000000000 -0700
7 +++ spamass-milter/spamass-milter.cpp   2012-06-21 13:02:15.000000000 -0700
8 @@ -363,7 +363,7 @@
9  // }}}
10  
11  /* Update a header if SA changes it, or add it if it is new. */
12 -void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_setter setter, char *header )
13 +void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_setter setter, const char *header )
14  {
15         string::size_type eoh1 = assassin->d().find("\n\n");
16         string::size_type eoh2 = assassin->d().find("\n\r\n");
17 @@ -386,15 +386,16 @@
18                 {
19                         /* change if old one was present, append if non-null */
20                         char* cstr = const_cast<char*>(newstring.c_str());
21 +                       char* hstr = const_cast<char*>(header);
22                         if (oldsize > 0)
23                         {
24                                 debug(D_UORI, "u_or_i: changing");
25 -                               smfi_chgheader(ctx, header, 1, newstring.size() > 0 ? 
26 +                               smfi_chgheader(ctx, hstr, 1, newstring.size() > 0 ? 
27                                         cstr : NULL );
28                         } else if (newstring.size() > 0)
29                         {
30                                 debug(D_UORI, "u_or_i: inserting");
31 -                               smfi_addheader(ctx, header, cstr);
32 +                               smfi_addheader(ctx, hstr, cstr);
33                         }
34                 } else
35                 {