diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-09 20:45:11 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-09 20:45:11 +0400 |
commit | 2234daebbb352b444b322d43cc6c1093f0ce949c (patch) | |
tree | 320131facabccd4f5aa3eddc465bc50a707b2b00 /src/fstring.c | |
parent | 19baadf6a0e6b2554de67b674a2c6f30efda13bb (diff) | |
download | rspamd-2234daebbb352b444b322d43cc6c1093f0ce949c.tar.gz rspamd-2234daebbb352b444b322d43cc6c1093f0ce949c.zip |
* Make autolearn working
Diffstat (limited to 'src/fstring.c')
-rw-r--r-- | src/fstring.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fstring.c b/src/fstring.c index 935c8bdcc..00ca4ed12 100644 --- a/src/fstring.c +++ b/src/fstring.c @@ -306,19 +306,20 @@ fstrhash (f_str_t *str) size_t i; uint32_t hval; uint32_t tmp; + char *c = str->begin; if (str == NULL) { return 0; } hval = str->len; - for (i = 0; i < str->len; i++) { + for (i = 0; i < str->len; i++, c++) { /* * xor in the current byte against each byte of hval * (which alone gaurantees that every bit of input will have * an effect on the output) */ - tmp = *(str->begin + i) & 0xFF; + tmp = *c & 0xFF; tmp = tmp | (tmp << 8) | (tmp << 16) | (tmp << 24); hval ^= tmp; |