X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fhash.c;h=820c8f684adcd1ebf85969718b6c277d78850aa6;hp=dff84a67801f435de9484622cbf1964e257f553b;hb=43d9a62473338cd9e711b395e79c943f6e9857f2;hpb=490f28ffd1b42ee2076ce89c62d0e672ee7e541e diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c index dff84a67..820c8f68 100644 --- a/src/ngircd/hash.c +++ b/src/ngircd/hash.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: hash.c,v 1.6 2002/12/12 12:24:18 alex Exp $"; +static char UNUSED id[] = "$Id: hash.c,v 1.9 2002/12/26 16:25:43 alex Exp $"; #include "imp.h" #include @@ -38,9 +38,7 @@ Hash( CHAR *String ) CHAR buffer[LINE_LEN]; - strncpy( buffer, String, LINE_LEN - 1 ); - buffer[LINE_LEN - 1] = '\0'; - + strlcpy( buffer, String, sizeof( buffer )); return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 ); } /* Hash */ @@ -102,7 +100,7 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval /* handle the last 11 bytes */ c += length; - switch(len) /* all the case statements fall through */ + switch( (INT)len ) /* all the case statements fall through */ { case 11: c+=((UINT32)k[10]<<24); case 10: c+=((UINT32)k[9]<<16);