summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-06-13 21:23:17 +1000
committerDamien Miller <djm@mindrot.org>2000-06-13 21:23:17 +1000
commit1a13225d877ffdd035659bf5577d5aff388bb317 (patch)
tree360d9f55f05b21e4a46e42a190bfb1651faa8ac6 /loginrec.c
parenta66626b2d59d23a26cacfbcf938852a19d8b781d (diff)
downloadopenssh-git-1a13225d877ffdd035659bf5577d5aff388bb317.tar.gz
- (djm) Fix short copy in loginrec.c (based on patch from Phill Camp
<P.S.S.Camp@ukc.ac.uk>
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/loginrec.c b/loginrec.c
index 00136a95..59ce1808 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 @@ line_fullname(char *dst, const char *src, int dstsize)
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 @@ wtmp_get_entry(struct logininfo *li)
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 @@ wtmpx_get_entry(struct logininfo *li)
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) {