summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-26 09:43:01 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-26 09:43:01 +0800
commitd285fb7b02600b1b6ab1f2fd857eea2e974c1ffb (patch)
treee269cfb2336c5bbc55e38defcbe83eb702992687
parent963fef9b70263e62d5e693b5609890a3cec7e31e (diff)
downloadpttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.tar
pttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.tar.gz
pttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.tar.bz2
pttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.tar.lz
pttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.tar.xz
pttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.tar.zst
pttbbs-d285fb7b02600b1b6ab1f2fd857eea2e974c1ffb.zip
avoid some memory error (for last commiting board friends)
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@351 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 1f67f7e0..9f62424b 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -1,4 +1,4 @@
-/* $Id: cache.c,v 1.37 2002/06/26 01:12:48 in2 Exp $ */
+/* $Id: cache.c,v 1.38 2002/06/26 01:43:01 in2 Exp $ */
#include "bbs.h"
#ifndef __FreeBSD__
@@ -392,11 +392,12 @@ void sort_utmp()
for( i = 0 ; i < count ; ++i ){
uentp = SHM->sorted[ns][0][i];
if( uentp && uentp->pid &&
- 0 <= uentp->brc_id && uentp->brc_id < MAX_BOARD )
+ 0 < uentp->brc_id && uentp->brc_id < MAX_BOARD )
++nusers[ uentp->brc_id - 1 ];
}
- for( i = 0 ; i < MAX_BOARD ; ++i )
- SHM->bcache[i].nuser = nusers[i];
+ for( i = 0 ; i < SHM->Bnumber ; ++i )
+ if( SHM->bcache[i].brdname[0] != 0 )
+ SHM->bcache[i].nuser = nusers[i];
}
// Ptt:這邊加入hash觀念 找空的utmp