From b8b7a9ed5892fb3d59212f163c5c4eb8ad0f0790 Mon Sep 17 00:00:00 2001 From: ptt Date: Wed, 31 Mar 2004 00:54:36 +0000 Subject: cuser debug git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1642 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 10 +++++----- mbbsd/var.c | 2 +- 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; -- cgit v1.2.3