projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ssf is useful for sasl
[apps/madmutt.git]
/
lib-lib
/
hash.c
diff --git
a/lib-lib/hash.c
b/lib-lib/hash.c
index
008c8fe
..
c703def
100644
(file)
--- a/
lib-lib/hash.c
+++ b/
lib-lib/hash.c
@@
-40,7
+40,7
@@
int hash_string(const unsigned char *s, int n)
hash_t *hash_init(hash_t *table, int nelem, int allow_dup)
{
table->dupes = allow_dup;
hash_t *hash_init(hash_t *table, int nelem, int allow_dup)
{
table->dupes = allow_dup;
- table->nelem = M
IN
(nelem, 2);
+ table->nelem = M
AX
(nelem, 2);
table->curnelem = 0;
table->table = p_new(struct hash_elem *, table->nelem);
return table;
table->curnelem = 0;
table->table = p_new(struct hash_elem *, table->nelem);
return table;
@@
-117,7
+117,7
@@
int hash_insert(hash_t *table, const char *key, void *data)
if (r == 0) {
p_delete(&ptr);
if (r == 0) {
p_delete(&ptr);
- return
(-1)
;
+ return
-1
;
}
if (r > 0)
break;
}
if (r > 0)
break;
@@
-136,7
+136,7
@@
void *hash_find(const hash_t *table, const char *key)
for (ptr = table->table[hash]; ptr; ptr = ptr->next) {
if (m_strcmp(key, ptr->key) == 0)
for (ptr = table->table[hash]; ptr; ptr = ptr->next) {
if (m_strcmp(key, ptr->key) == 0)
- return
(ptr->data)
;
+ return
ptr->data
;
}
return NULL;
}
}
return NULL;
}