#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.11 2005/03/19 18:43:48 fw Exp $";
#include "imp.h"
#include <assert.h>
#include <string.h>
#include "defines.h"
-#include "log.h"
#include "tool.h"
#include "exp.h"
GLOBAL UINT32
-Hash( CHAR *String )
+Hash( char *String )
{
/* Hash-Wert ueber String berechnen */
- CHAR buffer[LINE_LEN];
+ 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 */
/* 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 */
/* handle the last 11 bytes */
c += length;
- switch( (INT)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);