summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-28 22:52:17 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-28 22:52:17 +0800
commit11d1c7126baec1ae053f6a4bf5fdac8646e50520 (patch)
tree35060696023db80d3c48762025d2cd9b4785f055
parentf2d4c718ec4bc26886d4aec0ded9308378660321 (diff)
downloadpttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.tar
pttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.tar.gz
pttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.tar.bz2
pttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.tar.lz
pttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.tar.xz
pttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.tar.zst
pttbbs-11d1c7126baec1ae053f6a4bf5fdac8646e50520.zip
fix a bug on remove .
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2439 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/uhash_loader.c14
1 files changed, 10 insertions, 4 deletions
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)