It doesn't seem to actually happen, but this makes sure of it.
} T_END;
for (i = 0; i < sizeof(hash); i++)
hash = (hash << CHAR_BIT) | md5[i];
+ if (hash == 0) {
+ /* Make sure we don't return the hash as 0, since it's often
+ treated in a special way that won't work well. For example
+ trying to insert it into a hash table will assert-crash. */
+ hash = 1;
+ }
return hash;
}
#define MAIL_USER_HASH
/* Return a hash for username, based on given format. The format can use
- %n, %d and %u variables. */
+ %n, %d and %u variables. The returned hash is never 0. */
unsigned int mail_user_hash(const char *username, const char *format);
#endif