summaryrefslogtreecommitdiff
path: root/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'user.c')
-rw-r--r--user.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/user.c b/user.c
index 064007b..a9e2927 100644
--- a/user.c
+++ b/user.c
@@ -2,6 +2,7 @@
#include <string.h>
#include "user.h"
+#include "sdbm.h"
struct user_t *users;
@@ -10,15 +11,6 @@ void user_init() {
memset(users, 0, sizeof(struct user_t) * USERS_MAX);
}
-static unsigned long sdbm(char *str) {
- unsigned long hash = 0;
- int c;
- while(c = *str++) {
- hash = c + (hash << 6) + (hash << 16) - hash;
- }
- return hash;
-}
-
struct user_t *user_get(char *nick) {
unsigned long hash = sdbm(nick);
int index = hash % USERS_MAX;