X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fhash.c;h=820c8f684adcd1ebf85969718b6c277d78850aa6;hb=ff2c1efae8b8b1bf30013123bb17243dc682f7d3;hp=34da798c6f59b7687127560f5fe60b77d8f1ef6e;hpb=1934257636d635b835183466d24714a2ae91bf9c;p=ngircd-alex.git diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c index 34da798c..820c8f68 100644 --- a/src/ngircd/hash.c +++ b/src/ngircd/hash.c @@ -2,21 +2,20 @@ * ngIRCd -- The Next Generation IRC Daemon * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) * - * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen - * der GNU General Public License (GPL), wie von der Free Software Foundation - * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 - * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. - * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste - * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: hash.c,v 1.5 2002/05/27 12:54:07 alex Exp $ - * - * hash.c: Hash-Werte berechnen + * Hash calculation */ #include "portab.h" +static char UNUSED id[] = "$Id: hash.c,v 1.9 2002/12/26 16:25:43 alex Exp $"; + #include "imp.h" #include #include @@ -39,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 */ @@ -103,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);