diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-28 23:35:54 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-28 23:35:54 +0800 |
commit | 75ce618731831b235e3f6b8e2298e96c73d89da2 (patch) | |
tree | 7fe9c64009614f3640ef7c045365badd8cd5f70a /mbbsd/cache.c | |
parent | 11d1c7126baec1ae053f6a4bf5fdac8646e50520 (diff) | |
download | pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.tar pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.tar.gz pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.tar.bz2 pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.tar.lz pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.tar.xz pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.tar.zst pttbbs-75ce618731831b235e3f6b8e2298e96c73d89da2.zip |
uhash problem
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2440 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r-- | mbbsd/cache.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index f4996ffb..fee5d950 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -219,35 +219,16 @@ void setuserid(int num, char *userid) { if (num > 0 && num <= MAX_USERS) { +/* Ptt: it may cause problems if (num > SHM->number) SHM->number = num; else - remove_from_uhash(num - 1); +*/ + remove_from_uhash(num - 1); add_to_uhash(num - 1, userid); } } -/* 0 ==> 找過期帳號 */ -/* 1 ==> 建立新帳號 */ -/* should do it by searching "" in the hash */ -int -searchnewuser(int mode) -{ - register int i, num; - - num = SHM->number; - i = 0; - - /* 為什麼這邊不用 hash table 去找而要用 linear search? */ - while (i < num) { - if (!SHM->userid[i++][0]) - return i; - } - if (mode && (num < MAX_USERS)) - return num + 1; - return 0; -} - #ifndef _BBS_UTIL_C_ char * u_namearray(char buf[][IDLEN + 1], int *pnum, char *tag) |