Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ftpd use strl*, not strn*.
details: https://anonhg.NetBSD.org/src/rev/1c5e4d71103f
branches: trunk
changeset: 536248:1c5e4d71103f
user: itojun <itojun%NetBSD.org@localhost>
date: Thu Sep 12 08:55:31 2002 +0000
description:
use strl*, not strn*.
diffstat:
libexec/ftpd/ftpd.c | 16 ++++++++--------
libexec/ftpd/logwtmp.c | 10 +++++-----
2 files changed, 13 insertions(+), 13 deletions(-)
diffs (75 lines):
diff -r 39a353e1d567 -r 1c5e4d71103f libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c Thu Sep 12 07:31:13 2002 +0000
+++ b/libexec/ftpd/ftpd.c Thu Sep 12 08:55:31 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpd.c,v 1.142 2002/09/12 06:40:43 lukem Exp $ */
+/* $NetBSD: ftpd.c,v 1.143 2002/09/12 08:55:31 itojun Exp $ */
/*
* Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@
#if 0
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: ftpd.c,v 1.142 2002/09/12 06:40:43 lukem Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.143 2002/09/12 08:55:31 itojun Exp $");
#endif
#endif /* not lint */
@@ -928,9 +928,9 @@
utmpx.ut_id[2] = 'p';
utmpx.ut_id[3] = '*';
utmpx.ut_type = USER_PROCESS;
- (void)strncpy(utmpx.ut_name, name, sizeof(utmpx.ut_name));
- (void)strncpy(utmpx.ut_line, line, sizeof(utmpx.ut_line));
- (void)strncpy(utmpx.ut_host, host, sizeof(utmpx.ut_host));
+ (void)strlcpy(utmpx.ut_name, name, sizeof(utmpx.ut_name));
+ (void)strlcpy(utmpx.ut_line, line, sizeof(utmpx.ut_line));
+ (void)strlcpy(utmpx.ut_host, host, sizeof(utmpx.ut_host));
loginx(&utmpx);
}
if (dowtmp)
@@ -940,9 +940,9 @@
if (doutmp) {
(void)memset(&utmp, 0, sizeof(utmp));
(void)time(&utmp.ut_time);
- (void)strncpy(utmp.ut_name, name, sizeof(utmp.ut_name));
- (void)strncpy(utmp.ut_line, line, sizeof(utmp.ut_line));
- (void)strncpy(utmp.ut_host, host, sizeof(utmp.ut_host));
+ (void)strlcpy(utmp.ut_name, name, sizeof(utmp.ut_name));
+ (void)strlcpy(utmp.ut_line, line, sizeof(utmp.ut_line));
+ (void)strlcpy(utmp.ut_host, host, sizeof(utmp.ut_host));
login(&utmp);
}
if (dowtmp)
diff -r 39a353e1d567 -r 1c5e4d71103f libexec/ftpd/logwtmp.c
--- a/libexec/ftpd/logwtmp.c Thu Sep 12 07:31:13 2002 +0000
+++ b/libexec/ftpd/logwtmp.c Thu Sep 12 08:55:31 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: logwtmp.c,v 1.16 2001/02/04 22:04:12 christos Exp $ */
+/* $NetBSD: logwtmp.c,v 1.17 2002/09/12 08:55:31 itojun Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: logwtmp.c,v 1.16 2001/02/04 22:04:12 christos Exp $");
+__RCSID("$NetBSD: logwtmp.c,v 1.17 2002/09/12 08:55:31 itojun Exp $");
#endif
#endif /* not lint */
@@ -81,9 +81,9 @@
if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
return;
if (fstat(fd, &buf) == 0) {
- (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
- (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
- (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
+ (void)strlcpy(ut.ut_line, line, sizeof(ut.ut_line));
+ (void)strlcpy(ut.ut_name, name, sizeof(ut.ut_name));
+ (void)strlcpy(ut.ut_host, host, sizeof(ut.ut_host));
(void)time(&ut.ut_time);
if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
Home |
Main Index |
Thread Index |
Old Index