From 5f68d7e1a724af13aa4ead16da72bc91bd564e4d Mon Sep 17 00:00:00 2001 From: kcwu Date: Sun, 13 Mar 2005 19:56:29 +0000 Subject: bugfix: some user will always stay in friends' friend list after logout git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2620 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 2 +- util/shmctl.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 129f9b43..00ff1c83 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -282,7 +282,7 @@ logout_friend_online(userinfo_t * utmp) thefriend = (utmp->friend_online[my_friend_idx] & 0xFFFFFF); utmp->friend_online[my_friend_idx]=0; - if( !(0 <= thefriend && thefriend < MAX_ACTIVE) ) + if( !(0 <= thefriend && thefriend < USHM_SIZE) ) continue; ui = &SHM->uinfo[thefriend]; diff --git a/util/shmctl.c b/util/shmctl.c index 0686786a..0bd7e01a 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -20,7 +20,7 @@ int logout_friend_online(userinfo_t *utmp) thefriend = (utmp->friend_online[my_friend_idx] & 0xFFFFFF); utmp->friend_online[my_friend_idx]=0; - if( !(0 <= thefriend && thefriend < MAX_ACTIVE) ) { + if( !(0 <= thefriend && thefriend < USHM_SIZE) ) { printf("\tonline friend error(%d)\n", thefriend); continue; } @@ -709,7 +709,7 @@ int nkwbd(int argc, char **argv) int i; time_t t = SHM->GV2.e.now - timeout; - for( i = 0 ; i < MAX_ACTIVE ; ++i ) + for( i = 0 ; i < USHM_SIZE ; ++i ) if( SHM->uinfo[i].pid && SHM->uinfo[i].wbtime && SHM->uinfo[i].wbtime < t ){ @@ -842,7 +842,7 @@ int usermode(int argc, char **argv) { int i, modes[MAX_MODES]; memset(modes, 0, sizeof(modes)); - for( i = 0 ; i < MAX_ACTIVE ; ++i ) + for( i = 0 ; i < USHM_SIZE ; ++i ) if( SHM->uinfo[i].userid[0] ) ++modes[ (int)SHM->uinfo[i].mode ]; -- cgit v1.2.3