summaryrefslogtreecommitdiffstats
path: root/mbbsd/talk.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-10 04:31:50 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-10 04:31:50 +0800
commit2be2268af61905f408f33f2a4d439829ca23a0be (patch)
treed4b2439cc9ffb1ef5a6a3596c0d4824b84f733ba /mbbsd/talk.c
parentbee171e6635b88aa65c696f4ff2665cddf886e48 (diff)
downloadpttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.tar
pttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.tar.gz
pttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.tar.bz2
pttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.tar.lz
pttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.tar.xz
pttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.tar.zst
pttbbs-2be2268af61905f408f33f2a4d439829ca23a0be.zip
fix logout_friend()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@93 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r--mbbsd/talk.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index d2c6fb8a..1cd94a54 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.19 2002/04/09 20:10:31 in2 Exp $ */
+/* $Id: talk.c,v 1.20 2002/04/09 20:31:50 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -255,17 +255,17 @@ int login_friend_online(void)
return 0;
}
-int logout_friend_online(void)
+int logout_friend_online(userinfo_t *utmp)
{
int i, j, k;
- int offset=(int) (currutmp - &utmpshm->uinfo[0]);
+ int offset=(int) (utmp - &utmpshm->uinfo[0]);
userinfo_t *ui;
- while(currutmp->friendtotal){
- i = currutmp->friendtotal-1;
- j = (currutmp->friend_online[i] & 0xFFFFFF);
- currutmp->friend_online[i]=0;
+ while(utmp->friendtotal){
+ i = utmp->friendtotal-1;
+ j = (utmp->friend_online[i] & 0xFFFFFF);
+ utmp->friend_online[i]=0;
ui = &utmpshm->uinfo[j];
- if(ui->pid && ui!=currutmp){
+ if(ui->pid && ui!=utmp){
for(k=0; k<ui->friendtotal &&
(int)(ui->friend_online[k] & 0xFFFFFF) !=offset; k++);
if(k<ui->friendtotal){
@@ -274,8 +274,8 @@ int logout_friend_online(void)
ui->friend_online[ui->friendtotal]=0;
}
}
- currutmp->friendtotal--;
- currutmp->friend_online[currutmp->friendtotal]=0;
+ utmp->friendtotal--;
+ utmp->friend_online[utmp->friendtotal]=0;
}
return 0;
}