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)
- (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 00136a952..59ce1808a 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -170,7 +170,7 @@
170#include "xmalloc.h" 170#include "xmalloc.h"
171#include "loginrec.h" 171#include "loginrec.h"
172 172
173RCSID("$Id: loginrec.c,v 1.5 2000/06/12 22:21:44 andre Exp $"); 173RCSID("$Id: loginrec.c,v 1.6 2000/06/13 11:23:17 djm Exp $");
174 174
175/** 175/**
176 ** prototypes for helper functions in this file 176 ** prototypes for helper functions in this file
@@ -438,7 +438,7 @@ line_fullname(char *dst, const char *src, int dstsize)
438 if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5))) 438 if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5)))
439 strlcpy(dst, src, dstsize); 439 strlcpy(dst, src, dstsize);
440 else { 440 else {
441 strlcpy(dst, "/dev/", 5); 441 strlcpy(dst, "/dev/", dstsize);
442 strlcat(dst, src, dstsize); 442 strlcat(dst, src, dstsize);
443 } 443 }
444 return dst; 444 return dst;
@@ -958,9 +958,9 @@ wtmp_get_entry(struct logininfo *li)
958 li->tv_sec = ut.ut_tv.tv_sec; 958 li->tv_sec = ut.ut_tv.tv_sec;
959# endif 959# endif
960#endif 960#endif
961 line_fullname(li->line, ut.ut_line, sizeof(ut.ut_line)); 961 line_fullname(li->line, ut.ut_line, sizeof(li->line));
962#ifdef HAVE_HOST_IN_UTMP 962#ifdef HAVE_HOST_IN_UTMP
963 strlcpy(li->hostname, ut.ut_host, sizeof(ut.ut_host)); 963 strlcpy(li->hostname, ut.ut_host, sizeof(li->hostname));
964#endif 964#endif
965 } 965 }
966 if (lseek(fd, (off_t)(0-2*sizeof(struct utmp)), SEEK_CUR) == -1) { 966 if (lseek(fd, (off_t)(0-2*sizeof(struct utmp)), SEEK_CUR) == -1) {
@@ -1096,9 +1096,9 @@ wtmpx_get_entry(struct logininfo *li)
1096 li->tv_sec = utx.ut_time; 1096 li->tv_sec = utx.ut_time;
1097# endif 1097# endif
1098#endif 1098#endif
1099 line_fullname(li->line, utx.ut_line, sizeof(utx.ut_line)); 1099 line_fullname(li->line, utx.ut_line, sizeof(li->line));
1100#ifdef HAVE_HOST_IN_UTMPX 1100#ifdef HAVE_HOST_IN_UTMPX
1101 strlcpy(li->hostname, utx.ut_host, sizeof(utx.ut_line)); 1101 strlcpy(li->hostname, utx.ut_host, sizeof(li->hostname));
1102#endif 1102#endif
1103 } 1103 }
1104 if (lseek(fd, (off_t)(0-2*sizeof(struct utmpx)), SEEK_CUR) == -1) { 1104 if (lseek(fd, (off_t)(0-2*sizeof(struct utmpx)), SEEK_CUR) == -1) {