diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-01 02:16:33 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-01 02:16:33 +0800 |
commit | feacdd104da0b2493c683c9b0536d957499a480a (patch) | |
tree | 33e6976326346a9eb4188e61010e0eedbe76d68e | |
parent | e4ee6ceb85fbbc243bbad08d7fb16c489928012f (diff) | |
download | pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.tar pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.tar.gz pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.tar.bz2 pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.tar.lz pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.tar.xz pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.tar.zst pttbbs-feacdd104da0b2493c683c9b0536d957499a480a.zip |
avoid utmp->friendtotal error
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@397 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/shmctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/shmctl.c b/util/shmctl.c index 2ce7982b..348b6024 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -1,4 +1,4 @@ -/* $Id: shmctl.c,v 1.22 2002/06/26 01:57:49 in2 Exp $ */ +/* $Id: shmctl.c,v 1.23 2002/06/30 18:16:33 in2 Exp $ */ #include "bbs.h" extern SHM_t *SHM; @@ -9,6 +9,8 @@ int logout_friend_online(userinfo_t *utmp) int offset=(int) (utmp - &SHM->uinfo[0]); userinfo_t *ui; while(utmp->friendtotal){ + if( !(0 <= utmp->friendtotal && utmp->friendtotal < MAX_FRIEND) ) + return 1; i = utmp->friendtotal-1; j = (utmp->friend_online[i] & 0xFFFFFF); if( !(0 <= j && j < MAX_ACTIVE) ) |