Mercurial > dnsbl
diff src/dnsbl.cpp @ 227:3fee608becbc stable-6-0-21
Fixes to compile on old systems without memrchr or string::clear().
Fix bug in spamassassin interface trying to clear a string with string::empty().
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 03 Jan 2009 15:16:47 -0800 |
parents | 8e1cbf3d96fc |
children | ad38575e98ca |
line wrap: on
line diff
--- a/src/dnsbl.cpp Sat Jan 03 10:07:10 2009 -0800 +++ b/src/dnsbl.cpp Sat Jan 03 15:16:47 2009 -0800 @@ -65,6 +65,17 @@ #include "daemon.c" #endif +#ifndef HAVE_MEMRCHR + void *memrchr(const void *a, int c, size_t len); + void *memrchr(const void *a, int c, size_t len) { + const unsigned char *p = (const unsigned char *)a; + for (p += len-1; (const void *)p >= a; p--) + if (*p == c) + return (void *)p; + return (void *)0; + } +#endif + extern "C" { sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr); sfsistat mlfi_helo(SMFICTX * ctx, char *helohost);