summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 11:28:52 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 11:28:52 +0800
commit1302ba597718473328623b0d45c911c08e9e00f3 (patch)
treea55004583e0afeda0428d784e63a0fd7ef62d7d7 /mbbsd/mbbsd.c
parent389688bf4c143e2dc9d69613fdf4f653af7d0332 (diff)
downloadpttbbs-1302ba597718473328623b0d45c911c08e9e00f3.tar
pttbbs-1302ba597718473328623b0d45c911c08e9e00f3.tar.gz
pttbbs-1302ba597718473328623b0d45c911c08e9e00f3.tar.bz2
pttbbs-1302ba597718473328623b0d45c911c08e9e00f3.tar.lz
pttbbs-1302ba597718473328623b0d45c911c08e9e00f3.tar.xz
pttbbs-1302ba597718473328623b0d45c911c08e9e00f3.tar.zst
pttbbs-1302ba597718473328623b0d45c911c08e9e00f3.zip
debug log_usies
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1650 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 1d6ba481..7d414e30 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -113,23 +113,24 @@ log_usies(char *mode, char *mesg)
{
char genbuf[200];
- if (!mesg)
- snprintf(genbuf, sizeof(genbuf),
- cuser ? "%s %s %-12s Stay:%d (%s)\n" :
- "%s %s %s Stay:%d (%s)\n",
- Cdate(&now), mode, cuser ? cuser->userid :"",
- (int)(now - login_start_time) / 60, cuser ? cuser->username:"");
- else
- snprintf(genbuf, sizeof(genbuf),
- cuser ? "%s %s %-12s %s\n" : "%s %s %s%s\n",
- Cdate(&now), mode, cuser ? cuser->userid :"", mesg);
+
+ sprintf(genbuf, "%-10.10s %-10.10s Stay:%-10d", Cdate(&now), mode,
+ (int)(now - login_start_time) / 60);
+
+ if(cuser && cuser->userid[0])
+ sprintf(genbuf+38, "%s %s ", cuser->userid, cuser->username);
+
+ if(mesg)
+ strcat(genbuf, mesg);
+
log_file(FN_USIES, genbuf, 1);
/* °lÂÜ¨Ï¥ÎªÌ */
- if (HAS_PERM(PERM_LOGUSER))
- log_user(genbuf);
+ if (cuser && HAS_PERM(PERM_LOGUSER))
+ log_user(genbuf);
}
+
static void
setflags(int mask, int value)
{