summaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-08-14 20:54:52 +0000
committerKevin Steves <stevesk@pobox.com>2001-08-14 20:54:52 +0000
commit72992afb264bb7601e98e34f02fc524145081fe7 (patch)
tree9799906859c3ad7092e20ba08f57525f6e52afb3 /openbsd-compat
parent25ee4e48f79681ce76122d2b4ddda46efcd37ca0 (diff)
- (stevesk) bsd-cray.c: utmp strings are not C strings
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/bsd-cray.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c
index 3cef7d15..a03344f7 100644
--- a/openbsd-compat/bsd-cray.c
+++ b/openbsd-compat/bsd-cray.c
@@ -164,9 +164,10 @@ cray_retain_utmp(struct utmp *ut, int pid)
while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) {
if (pid == utmp.ut_pid) {
ut->ut_jid = utmp.ut_jid;
- strncpy(ut->ut_tpath, utmp.ut_tpath, TPATHSIZ);
- strncpy(ut->ut_host, utmp.ut_host, strlen(utmp.ut_host));
- strncpy(ut->ut_name, utmp.ut_name, strlen(utmp.ut_name));
+ /* XXX: MIN_SIZEOF here? can this go in loginrec? */
+ strncpy(ut->ut_tpath, utmp.ut_tpath, sizeof(utmp.ut_tpath));
+ strncpy(ut->ut_host, utmp.ut_host, sizeof(utmp.ut_host));
+ strncpy(ut->ut_name, utmp.ut_name, sizeof(utmp.ut_name));
break;
}
}