summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 08:54:36 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 08:54:36 +0800
commitb8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790 (patch)
tree06348958117c6ad9e182ee84b499da5672ecab8f /mbbsd
parent6e73dec7f6f649a84e41c4a35c6655c9adef6acc (diff)
downloadpttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.tar
pttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.tar.gz
pttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.tar.bz2
pttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.tar.lz
pttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.tar.xz
pttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.tar.zst
pttbbs-b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790.zip
cuser debug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1642 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c10
-rw-r--r--mbbsd/var.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index bea7c3b7..8d6219f4 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -115,14 +115,14 @@ log_usies(char *mode, char *mesg)
if (!mesg)
snprintf(genbuf, sizeof(genbuf),
- cuser->userid[0] ? "%s %s %-12s Stay:%d (%s)\n" :
+ cuser ? "%s %s %-12s Stay:%d (%s)\n" :
"%s %s %s Stay:%d (%s)\n",
- Cdate(&now), mode, cuser->userid,
- (int)(now - login_start_time) / 60, cuser->username);
+ Cdate(&now), mode, cuser ? cuser->userid :"",
+ (int)(now - login_start_time) / 60, cuser ? cuser->username:"");
else
snprintf(genbuf, sizeof(genbuf),
- cuser->userid[0] ? "%s %s %-12s %s\n" : "%s %s %s%s\n",
- Cdate(&now), mode, cuser->userid, mesg);
+ cuser ? "%s %s %-12s %s\n" : "%s %s %s%s\n",
+ Cdate(&now), mode, cuser ? cuser->userid :"", mesg);
log_file(FN_USIES, genbuf, 1);
/* °lÂÜ¨Ï¥ÎªÌ */
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 1b426b0d..abe28916 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -95,7 +95,7 @@ pid_t currpid; /* current process ID */
time_t login_start_time;
time_t start_time;
time_t paste_time;
-userec_t *cuser; /* current user structure */
+userec_t *cuser=NULL; /* current user structure */
userec_t xuser; /* lookup user structure */
crosspost_t postrecord; /* anti cross post */
unsigned int currbrdattr;