]> granicus.if.org Git - mutt/commitdiff
Make hash_string work in unsigned domain
authorBrendan Cully <brendan@kublai.com>
Sat, 3 Jan 2009 22:00:25 +0000 (14:00 -0800)
committerBrendan Cully <brendan@kublai.com>
Sat, 3 Jan 2009 22:00:25 +0000 (14:00 -0800)
ChangeLog
hash.c
hash.h

index 77e147540f451a28053749f5d620a2a4ca854990..b8e98f1dd4e73770b195cd9babd5490d08af0647 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
-2009-01-02 22:37 -0800  Brendan Cully  <brendan@kublai.com>  (37ed3cc8d40c)
+2009-01-03 12:04 -0800  Brendan Cully  <brendan@kublai.com>  (a5981715a4ed)
+
+       * main.c: Another copyright update
+
+       * main.c, smtp.c: Update some copyrights
+
+2009-01-02 23:13 -0800  Brendan Cully  <brendan@kublai.com>  (87ef3e3550e4)
+
+       * smtp.c: SMTP: Use Hostname if Fqdn is bogus. Closes #3142.
 
        * init.h: More tyops
 
diff --git a/hash.c b/hash.c
index 97a9eb4f9d26330d7d7c8896819defdb9620ec7f..7e4e19fd6f8ce4770b6ef79b44b8fd154cd1daf1 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -28,7 +28,7 @@
 
 #define SOMEPRIME 149711
 
-int hash_string (const unsigned char *s, int n)
+unsigned int hash_string (const unsigned char *s, unsigned int n)
 {
   unsigned int h = 0;
 
@@ -36,7 +36,7 @@ int hash_string (const unsigned char *s, int n)
     h += (h << 7) + *s++;
   h = (h * SOMEPRIME) % n;
 
-  return (signed) h;
+  return h;
 }
 
 HASH *hash_create (int nelem)
diff --git a/hash.h b/hash.h
index 74bf4bae823318a6af04ef7485679ac089db660d..5338aca45e90cc8c3f3bcbb13bef692321e1f166 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -38,7 +38,7 @@ HASH;
 #define hash_delete(table,key,data,destroy) hash_delete_hash(table, hash_string ((unsigned char *)key, table->nelem), key, data, destroy)
 
 HASH *hash_create (int nelem);
-int hash_string (const unsigned char *s, int n);
+unsigned int hash_string (const unsigned char *s, unsigned int n);
 int hash_insert (HASH * table, const char *key, void *data, int allow_dup);
 void *hash_find_hash (const HASH * table, int hash, const char *key);
 void hash_delete_hash (HASH * table, int hash, const char *key, const void *data,