diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-22 23:59:07 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-22 23:59:07 +0800 |
commit | 5fbdbcb03b25c100312335bea7d322051c8f5d61 (patch) | |
tree | a251d100a46256faa109e0ddfe25327bf73a46ca /mbbsd | |
parent | 0380885e086cf21f11636d3b0c93abe12414968f (diff) | |
download | pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.tar pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.tar.gz pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.tar.bz2 pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.tar.lz pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.tar.xz pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.tar.zst pttbbs-5fbdbcb03b25c100312335bea7d322051c8f5d61.zip |
avoid search_ulistn from -1 when there's nobody online
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@189 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/cache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 9f3dab99..e672ee56 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.26 2002/05/22 15:42:26 in2 Exp $ */ +/* $Id: cache.c,v 1.27 2002/05/22 15:59:07 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -490,6 +490,8 @@ userinfo_t *search_ulist_pid(int pid) { userinfo_t *search_ulistn(int uid, int unum) { register int i=0, j, start = 0, end = utmpshm->number - 1; register userinfo_t **ulist; + if( end == -1 ) + return NULL; ulist=utmpshm->sorted[utmpshm->currsorted][6]; for(i=((start+end)/2); ;i=(start+end)/2) { @@ -519,6 +521,8 @@ userinfo_t *search_ulistn(int uid, int unum) { int count_logins(int uid, int show) { register int i=0, j, start = 0, end = utmpshm->number - 1, count; register userinfo_t **ulist; + if( end == -1 ) + return NULL; ulist=utmpshm->sorted[utmpshm->currsorted][6]; for(i=((start+end)/2); ;i=(start+end)/2) { |