]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/hash.c
- das Error-File wird nun komplett durch das Log-Modul verwaltet, der
[ngircd-alex.git] / src / ngircd / hash.c
index d6cb516a002161a8b616998dd75ad91154b9a025..876b92f5e41c18fc222151dc28a573839ea4677a 100644 (file)
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: hash.c,v 1.2 2002/03/14 15:49:36 alex Exp $
+ * $Id: hash.c,v 1.4 2002/03/25 19:11:01 alex Exp $
  *
  * hash.c: Hash-Werte berechnen
  */
 
 #include "imp.h"
 #include <assert.h>
+#include <string.h>
+
+#include "defines.h"
+#include "log.h"
+#include "tool.h"
 
 #include "exp.h"
 #include "hash.h"
@@ -30,7 +35,13 @@ LOCAL UINT32 jenkins_hash( register UINT8 *k, register UINT32 length, register U
 GLOBAL UINT32 Hash( CHAR *String )
 {
        /* Hash-Wert ueber String berechnen */
-       return jenkins_hash( String, strlen( String ), 42 );
+
+       CHAR buffer[LINE_LEN];
+
+       strncpy( buffer, String, LINE_LEN - 1 );
+       buffer[LINE_LEN - 1] = '\0';
+       
+       return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 );
 } /* Hash */