diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-16 12:38:20 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-16 12:38:20 +0800 |
commit | ad753788de6bfe5a05145bf954b4bb43bce9e3ac (patch) | |
tree | 7829ea26833c4f4977eda07563bd98334968a0ad /mbbsd/mbbsd.c | |
parent | 6017ae543885ba2d8204ded8bc1a55bdeb57a5ad (diff) | |
download | pttbbs-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
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 22 |
1 files changed, 11 insertions, 11 deletions
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); /* °lÂÜ¨Ï¥ÎªÌ */ - if (cuser && HAS_PERM(PERM_LOGUSER)) + if (HAS_PERM(PERM_LOGUSER)) log_user(genbuf); } |