- (stevesk) bsd-cray.c: utmp strings are not C strings
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c
index 3cef7d1..a03344f 100644
--- a/openbsd-compat/bsd-cray.c
+++ b/openbsd-compat/bsd-cray.c
@@ -164,9 +164,10 @@
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;
}
}