From 11d1c7126baec1ae053f6a4bf5fdac8646e50520 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 28 Jan 2005 14:52:17 +0000 Subject: fix a bug on remove . git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2439 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/uhash_loader.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'util/uhash_loader.c') diff --git a/util/uhash_loader.c b/util/uhash_loader.c index ed902689..550067b8 100644 --- a/util/uhash_loader.c +++ b/util/uhash_loader.c @@ -53,16 +53,22 @@ void load_uhash(void) { void checkhash(int h) { - int *p = &(SHM->hash_head[h]), ch; + int *p = &(SHM->hash_head[h]), ch, deep=0; while(*p != -1) { ch = string_hash( SHM->userid[*p]); if(ch!=h) { - printf("remove %d!=%d %d [%s]\n", h, ch, *p, SHM->userid[*p]); - *p = SHM->next_in_hash[*p]; //remove from link + printf("remove %d %d!=%d %d [%s] next:%d\n", + deep, h, ch, *p, SHM->userid[*p], + SHM->next_in_hash[*p]); + *p = SHM->next_in_hash[*p]; //remove from link + // *p=-1; Ptt: cut it? + //return; } - p = &(SHM->next_in_hash[*p]); + else + p = &(SHM->next_in_hash[*p]); + deep++; } } void fill_uhash(int onfly) -- cgit v1.2.3