aboutsummaryrefslogtreecommitdiff
path: root/login/logwtmp.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-21 21:01:27 +0000
committerRoland McGrath <roland@gnu.org>1996-06-21 21:01:27 +0000
commit4f54cdb1dd4b8929231f42e22b79a0d5c7600cba (patch)
tree7780b1282b5f0849339424c2c94fc278f2dd8767 /login/logwtmp.c
parent51fbd1f60a5c43fc5bde04952bc88b5545a83d13 (diff)
downloadglibc-4f54cdb1dd4b8929231f42e22b79a0d5c7600cba.zip
glibc-4f54cdb1dd4b8929231f42e22b79a0d5c7600cba.tar.gz
glibc-4f54cdb1dd4b8929231f42e22b79a0d5c7600cba.tar.bz2
* sysdeps/sparc/elf/start.S: New file.
* sysdeps/sparc/dl-machine.h: New file. * posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr only for ?s, not for *s. Fix from Chet Ramey. Fixes thanks to Raja R Harinath <harinath@cs.umn.edu>: * sysdeps/unix/sysv/utmpbits.h: Define _HAVE_UT_{TYPE,ID,TV,HOST}. Use __{BEGIN,END}_DECLS. (_PATH_WTMP, _PATH_UTMP, _PATH_LASTLOG): New macros. * login/utmp.h (UTMP_FILE, UTMP_FILENAME, WTMP_FILE, WTMP_FILENAME): New macros, moved here from sysdeps/gnu/utmpbits.h. * sysdeps/generic/utmpbits.h (_HAVE_UT_HOST): Define it. * sysdeps/gnu/utmpbits.h (_HAVE_UT_HOST): Likewise. * login/logout.c: Use ut_host only #if _HAVE_UT_HOST. Use sizeof instead of UT_*SIZE. * login/logwtmp.c: Likewise. * misc/tsearch.c (tdelete): Define as weak alias to __tdelete. * version.c (banner): Add trailing newline.
Diffstat (limited to 'login/logwtmp.c')
-rw-r--r--login/logwtmp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/login/logwtmp.c b/login/logwtmp.c
index 10f7384..371f34e 100644
--- a/login/logwtmp.c
+++ b/login/logwtmp.c
@@ -45,9 +45,11 @@ logwtmp (const char *line, const char *name, const char *host)
#if _HAVE_UT_TYPE - 0
ut.ut_type = USER_PROCESS;
#endif
- strncpy (ut.ut_line, line, UT_LINESIZE);
- strncpy (ut.ut_name, name, UT_NAMESIZE);
- strncpy (ut.ut_host, host, UT_HOSTSIZE);
+ strncpy (ut.ut_line, line, sizeof ut.ut_line);
+ strncpy (ut.ut_name, name, sizeof ut.ut_name);
+#if _HAVE_UT_HOST - 0
+ strncpy (ut.ut_host, host, sizeof ut.ut_host);
+#endif
#if _HAVE_UT_TV - 0
gettimeofday (&ut.ut_tv, NULL);
@@ -60,5 +62,4 @@ logwtmp (const char *line, const char *name, const char *host)
/* Close UTMP file. */
endutent_r (&data);
-
}