[cvs] bogofilter/src memstr.c,1.1,1.2 memstr.h,1.1,1.2
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <m-...@us...> - 2004-10-09 02:53:35
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14206/src Modified Files: memstr.c memstr.h Log Message: Use const char * not const unsigned char *, to match strstr. Index: memstr.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/memstr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- memstr.c 9 Oct 2004 02:07:59 -0000 1.1 +++ memstr.c 9 Oct 2004 02:53:16 -0000 1.2 @@ -2,10 +2,10 @@ /* (C) 2004 Matthias Andree. License: GNU GPL v2 */ -void *memstr(const void *hay, size_t n, const unsigned char *needle) +void *memstr(const void *hay, size_t n, const char *needle) { unsigned const char *haystack = hay; - size_t l = strlen((const char *)needle); + size_t l = strlen(needle); while (n >= l) { if (0 == memcmp(haystack, needle, l)) Index: memstr.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/memstr.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- memstr.h 9 Oct 2004 02:07:59 -0000 1.1 +++ memstr.h 9 Oct 2004 02:53:16 -0000 1.2 @@ -6,6 +6,6 @@ #include <string.h> /** find needle in haystack (which is treated as unsigned char *). */ -void *memstr(const void *haystack, size_t n, const unsigned char *needle); +void *memstr(const void *haystack, size_t n, const char *needle); #endif |