summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-22 23:42:26 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-22 23:42:26 +0800
commita0788ed70447a75a42ed2cca63a49f40be72149d (patch)
treeb13c01585067da4b3649b3de8701caad4918dcc0
parent774e9e5046fecf6403172494dc59ee535327a757 (diff)
downloadpttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.tar
pttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.tar.gz
pttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.tar.bz2
pttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.tar.lz
pttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.tar.xz
pttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.tar.zst
pttbbs-a0788ed70447a75a42ed2cca63a49f40be72149d.zip
avoid search_ulistn from -1 when there's nobody online
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@187 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index ec85a4db..9f3dab99 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -1,4 +1,4 @@
-/* $Id: cache.c,v 1.25 2002/05/13 10:00:17 ptt Exp $ */
+/* $Id: cache.c,v 1.26 2002/05/22 15:42:26 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -463,6 +463,8 @@ extern int usernum;
userinfo_t *search_ulist_pid(int pid) {
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][7];
for(i=((start+end)/2); ;i=(start+end)/2)
{