From 41d283fee496ce5accbb91ece2b5bb009a494e42 Mon Sep 17 00:00:00 2001 From: in2 Date: Wed, 23 Oct 2002 17:10:04 +0000 Subject: 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 --- mbbsd/cache.c | 4 ++-- 1 file 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; -- cgit v1.2.3