diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-10-24 01:10:04 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-10-24 01:10:04 +0800 |
commit | 41d283fee496ce5accbb91ece2b5bb009a494e42 (patch) | |
tree | 0cac60e884ce89a601e513ab9d864ce3637dde83 | |
parent | 86672771393d552ac6d9c742fa1d80c34cc1cf74 (diff) | |
download | pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.tar pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.tar.gz pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.tar.bz2 pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.tar.lz pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.tar.xz pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.tar.zst pttbbs-41d283fee496ce5accbb91ece2b5bb009a494e42.zip |
in searchuser, return 0 if uhash is wrong
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@540 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 32da5a7f..ff3a8340 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.51 2002/08/27 21:16:12 kcwu Exp $ */ +/* $Id: cache.c,v 1.52 2002/10/23 17:10:04 in2 Exp $ */ #include "bbs.h" #ifndef __FreeBSD__ @@ -224,7 +224,7 @@ searchuser(char *userid) h = StringHash(userid); p = SHM->hash_head[h]; - for (times = 0; times < MAX_USERS && p != -1; ++times) { + for (times = 0; times < MAX_USERS && p != -1 && p < MAX_USERS ; ++times) { if (strcasecmp(SHM->userid[p], userid) == 0) { strcpy(userid, SHM->userid[p]); return p + 1; |