summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-16 12:38:20 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-16 12:38:20 +0800
commitad753788de6bfe5a05145bf954b4bb43bce9e3ac (patch)
tree7829ea26833c4f4977eda07563bd98334968a0ad
parent6017ae543885ba2d8204ded8bc1a55bdeb57a5ad (diff)
downloadpttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.tar
pttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.tar.gz
pttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.tar.bz2
pttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.tar.lz
pttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.tar.xz
pttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.tar.zst
pttbbs-ad753788de6bfe5a05145bf954b4bb43bce9e3ac.zip
log user's format
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1770 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cal.c2
-rw-r--r--mbbsd/mbbsd.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c
index 43c0d2f5..bfc06eb0 100644
--- a/mbbsd/cal.c
+++ b/mbbsd/cal.c
@@ -390,7 +390,7 @@ p_give()
return 0; /* 繳完稅就沒錢給了 */
deumoney(searchuser(id), money - tax);
demoney(-money);
- snprintf(genbuf, sizeof(genbuf), "%s\t給%s\t%d\t%s\n",
+ snprintf(genbuf, sizeof(genbuf), "%s\t給%s\t%d\t%s",
cuser->userid, id, money - tax, ctime(&now));
log_file(FN_MONEY, genbuf, 1);
genbuf[0] = 'n';
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 2276fb78..7f2eeb01 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -113,20 +113,20 @@ log_usies(char *mode, char *mesg)
{
char genbuf[200];
-
- sprintf(genbuf, "%-10.10s %-10.10s Stay:%-10d\n", Cdate(&now), mode,
- (int)(now - login_start_time) / 60);
-
- if(cuser && cuser->userid[0])
- sprintf(genbuf+38, "%s %s\n", cuser->userid, cuser->username);
-
- if(mesg)
- sprintf(genbuf + strlen(genbuf) - 1, " %s\n", mesg);
-
+ if (!mesg)
+ snprintf(genbuf, sizeof(genbuf),
+ cuser ? "%s %s %-12s Stay:%d (%s)" :
+ "%s %s %s Stay:%d (%s)",
+ 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" : "%s %s %s%s",
+ Cdate(&now), mode, cuser? cuser->userid:"", mesg);
log_file(FN_USIES, genbuf, 1);
/* 追蹤使用者 */
- if (cuser && HAS_PERM(PERM_LOGUSER))
+ if (HAS_PERM(PERM_LOGUSER))
log_user(genbuf);
}