summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-12 12:16:35 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-12 12:16:35 +0800
commitfda6d63bafd474518327879633b2231a5aaa6825 (patch)
tree5b3d291865da567e4ff0592facb0d58913a480bb /mbbsd/mbbsd.c
parent3f76b17cecfae6af61240a7ef9e5f21118e39f40 (diff)
downloadpttbbs-fda6d63bafd474518327879633b2231a5aaa6825.tar
pttbbs-fda6d63bafd474518327879633b2231a5aaa6825.tar.gz
pttbbs-fda6d63bafd474518327879633b2231a5aaa6825.tar.bz2
pttbbs-fda6d63bafd474518327879633b2231a5aaa6825.tar.lz
pttbbs-fda6d63bafd474518327879633b2231a5aaa6825.tar.xz
pttbbs-fda6d63bafd474518327879633b2231a5aaa6825.tar.zst
pttbbs-fda6d63bafd474518327879633b2231a5aaa6825.zip
rewrite few lines.
comment on strange lines. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2496 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 935111d7..9fc9225f 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -818,9 +818,8 @@ inline static void birthday_make_a_wish(struct tm *ptime, struct tm *tmp){
}
}
-inline static void record_lasthost(char *fromhost, int len){
- strncpy(cuser.lasthost, fromhost, len);
- cuser.lasthost[len - 1] = '\0';
+inline static void record_lasthost(char *fromhost){
+ strlcpy(cuser.lasthost, fromhost, sizeof(cuser.lasthost));
}
inline static void check_mailbox_quota(void){
@@ -956,7 +955,7 @@ user_login()
check_bad_login();
check_mailbox_quota();
check_register();
- record_lasthost(fromhost, 16);
+ record_lasthost(fromhost);
restore_backup();
} else if (!strcmp(cuser.userid, STR_GUEST)) {
init_guest_info();