]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/hash.c
- Enhanced (and fixed) CHANINFO command (channel keys, user limits).
[ngircd-alex.git] / src / ngircd / hash.c
index 79ad2b215b66eadc61e2919bc7c94702eb143c1c..820c8f684adcd1ebf85969718b6c277d78850aa6 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: hash.c,v 1.7 2002/12/25 13:22:43 alex Exp $";
+static char UNUSED id[] = "$Id: hash.c,v 1.9 2002/12/26 16:25:43 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -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 */
 
@@ -87,7 +85,7 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval
 
        /* Set up the internal state */
        len = length;
-       a = b = 0x9e3779b9u;    /* the golden ratio; an arbitrary value */
+       a = b = 0x9e3779b9    /* the golden ratio; an arbitrary value */
        c = initval;            /* the previous hash value */
 
        /* handle most of the key */