diff options
author | Kevin Steves <stevesk@pobox.com> | 2001-08-14 20:54:52 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@pobox.com> | 2001-08-14 20:54:52 +0000 |
commit | 72992afb264bb7601e98e34f02fc524145081fe7 (patch) | |
tree | 9799906859c3ad7092e20ba08f57525f6e52afb3 /openbsd-compat/bsd-cray.c | |
parent | 25ee4e48f79681ce76122d2b4ddda46efcd37ca0 (diff) |
- (stevesk) bsd-cray.c: utmp strings are not C strings
Diffstat (limited to 'openbsd-compat/bsd-cray.c')
-rw-r--r-- | openbsd-compat/bsd-cray.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c index 3cef7d15d..a03344f72 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) | |||
164 | while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) { | 164 | while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) { |
165 | if (pid == utmp.ut_pid) { | 165 | if (pid == utmp.ut_pid) { |
166 | ut->ut_jid = utmp.ut_jid; | 166 | ut->ut_jid = utmp.ut_jid; |
167 | strncpy(ut->ut_tpath, utmp.ut_tpath, TPATHSIZ); | 167 | /* XXX: MIN_SIZEOF here? can this go in loginrec? */ |
168 | strncpy(ut->ut_host, utmp.ut_host, strlen(utmp.ut_host)); | 168 | strncpy(ut->ut_tpath, utmp.ut_tpath, sizeof(utmp.ut_tpath)); |
169 | strncpy(ut->ut_name, utmp.ut_name, strlen(utmp.ut_name)); | 169 | strncpy(ut->ut_host, utmp.ut_host, sizeof(utmp.ut_host)); |
170 | strncpy(ut->ut_name, utmp.ut_name, sizeof(utmp.ut_name)); | ||
170 | break; | 171 | break; |
171 | } | 172 | } |
172 | } | 173 | } |