- (djm) Fix short copy in loginrec.c (based on patch from Phill Camp
   <P.S.S.Camp@ukc.ac.uk>
diff --git a/CREDITS b/CREDITS
index dab15a3..8d7014b 100644
--- a/CREDITS
+++ b/CREDITS
@@ -47,6 +47,7 @@
 Peter Kocks <peter.kocks@baygate.com> - Makefile fixes
 Phil Hands <phil@hands.com> - Debian scripts, assorted patches
 Phil Karn <karn@ka9q.ampr.org> - Autoconf fix
+Phill Camp <P.S.S.Camp@ukc.ac.uk> - login code fix
 SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp> - Multiple bugfixes
 Simon Wilkinson <sxw@dcs.ed.ac.uk> - PAM fixes
 Thomas Neumann <tom@smart.ruhr.de> - Shadow passwords
diff --git a/ChangeLog b/ChangeLog
index b360d36..1baf234 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
  - (djm) Fixes from Andrew McGill <andrewm@datrix.co.za>:
   - Platform define for SCO 3.x which breaks on /dev/ptmx
   - Detect and try to fix missing MAXPATHLEN
+ - (djm) Fix short copy in loginrec.c (based on patch from Phill Camp
+   <P.S.S.Camp@ukc.ac.uk>
 
 20000612
  - (djm) Glob manpages in RPM spec files to catch compressed files
diff --git a/configure.in b/configure.in
index 3bdf411..0e755e4 100644
--- a/configure.in
+++ b/configure.in
@@ -1162,4 +1162,3 @@
 
 AC_OUTPUT(Makefile ssh_prng_cmds)
 
-
diff --git a/loginrec.c b/loginrec.c
index 00136a9..59ce180 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -170,7 +170,7 @@
 #include "xmalloc.h"
 #include "loginrec.h"
 
-RCSID("$Id: loginrec.c,v 1.5 2000/06/12 22:21:44 andre Exp $");
+RCSID("$Id: loginrec.c,v 1.6 2000/06/13 11:23:17 djm Exp $");
 
 /**
  ** prototypes for helper functions in this file
@@ -438,7 +438,7 @@
 	if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5)))
 		strlcpy(dst, src, dstsize);
 	else {
-		strlcpy(dst, "/dev/", 5);
+		strlcpy(dst, "/dev/", dstsize);
 		strlcat(dst, src, dstsize);
 	}
 	return dst;
@@ -958,9 +958,9 @@
 			li->tv_sec = ut.ut_tv.tv_sec;
 #  endif
 #endif
-			line_fullname(li->line, ut.ut_line, sizeof(ut.ut_line));
+			line_fullname(li->line, ut.ut_line, sizeof(li->line));
 #ifdef HAVE_HOST_IN_UTMP
-			strlcpy(li->hostname, ut.ut_host, sizeof(ut.ut_host));
+			strlcpy(li->hostname, ut.ut_host, sizeof(li->hostname));
 #endif
 		}
 		if (lseek(fd, (off_t)(0-2*sizeof(struct utmp)), SEEK_CUR) == -1) {
@@ -1096,9 +1096,9 @@
 			li->tv_sec = utx.ut_time;
 #  endif
 #endif
-			line_fullname(li->line, utx.ut_line, sizeof(utx.ut_line));
+			line_fullname(li->line, utx.ut_line, sizeof(li->line));
 #ifdef HAVE_HOST_IN_UTMPX
-			strlcpy(li->hostname, utx.ut_host, sizeof(utx.ut_line));
+			strlcpy(li->hostname, utx.ut_host, sizeof(li->hostname));
 #endif
 		}
 		if (lseek(fd, (off_t)(0-2*sizeof(struct utmpx)), SEEK_CUR) == -1) {