X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=miscutil.c;h=09eeffaaeca731d72dac30af8a22a6a86fdb2fdf;hb=89d386383803cc9f1ccc5a06a14cc0b26888c273;hp=c149a44a056929f53c00979eb0a96224fe0ec696;hpb=a5823f709d110f48f4bf6d973fda0e0455d1506b;p=privoxy.git diff --git a/miscutil.c b/miscutil.c index c149a44a..09eeffaa 100644 --- a/miscutil.c +++ b/miscutil.c @@ -1,5 +1,4 @@ -/* vim:ts=3: */ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.12 2001/06/09 10:55:28 jongfoster Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.17 2001/09/13 20:51:29 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ @@ -37,6 +36,22 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.12 2001/06/09 10:55:28 jongfost * * Revisions : * $Log: miscutil.c,v $ + * Revision 1.17 2001/09/13 20:51:29 jongfoster + * Fixing potential problems with characters >=128 in simplematch() + * This was also a compiler warning. + * + * Revision 1.16 2001/09/10 10:56:59 oes + * Silenced compiler warnings + * + * Revision 1.15 2001/07/13 14:02:24 oes + * Removed vim-settings + * + * Revision 1.14 2001/06/29 21:45:41 oes + * Indentation, CRLF->LF, Tab-> Space + * + * Revision 1.13 2001/06/29 13:32:14 oes + * Removed logentry from cancelled commit + * * Revision 1.12 2001/06/09 10:55:28 jongfoster * Changing BUFSIZ ==> BUFFER_SIZE * @@ -111,12 +126,12 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.12 2001/06/09 10:55:28 jongfost #include #include -/* - * FIXME: Only need project.h for BUFFER_SIZE. It would be nice - * to remove this dependency. - */ -#include "project.h" -#include "miscutil.h" +/* + * FIXME: Only need project.h for BUFFER_SIZE. It would be nice + * to remove this dependency. + */ +#include "project.h" +#include "miscutil.h" #include "errlog.h" const char miscutil_h_rcs[] = MISCUTIL_H_VERSION; @@ -171,9 +186,9 @@ void *zalloc(int size) * Returns : an unsigned long variable with the hashed value. * *********************************************************************/ -unsigned long hash_string( const char* s ) +unsigned int hash_string( const char* s ) { - unsigned long h = 0ul; + unsigned int h = 0; for ( ; *s; ++s ) { @@ -446,12 +461,12 @@ char *strsav(char *old, const char *text_to_append) *********************************************************************/ int simplematch(char *pattern, char *text) { - char *fallback; - char *pat = pattern; - char *txt = text; + unsigned char *pat = (unsigned char *) pattern; + unsigned char *txt = (unsigned char *) text; + unsigned char *fallback = pat; int wildcard = 0; - char lastchar = 'a'; + unsigned char lastchar = 'a'; unsigned i; unsigned char charmap[32]; @@ -564,12 +579,12 @@ char *bindup(const char *string, int n) if (NULL == (dup = (char *)malloc(n))) { - return NULL; - } + return NULL; + } else - { - memcpy(dup, string, n); - } + { + memcpy(dup, string, n); + } return dup;