summaryrefslogtreecommitdiff
path: root/lib/libc/time/localtime.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 15:47:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 15:47:35 +0000
commit6c0bb8c7a42d42230f0786e8b4ca6567ded4fc69 (patch)
tree549f35a4cc07f24fe880b6d321af9a23b64cdbef /lib/libc/time/localtime.c
parent1e46612221e29a3f44b51938a54918044e96afd0 (diff)
a few more strlcy; ok from beck & ho
Diffstat (limited to 'lib/libc/time/localtime.c')
-rw-r--r--lib/libc/time/localtime.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index 88821b7d954..9690da0f63e 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -5,7 +5,7 @@
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
static char elsieid[] = "@(#)localtime.c 7.75";
-static char rcsid[] = "$OpenBSD: localtime.c,v 1.21 2002/04/04 19:12:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: localtime.c,v 1.22 2003/03/13 15:47:34 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -302,9 +302,9 @@ register struct state * const sp;
return -1;
if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
return -1;
- (void) strcpy(fullname, p);
- (void) strcat(fullname, "/");
- (void) strcat(fullname, name);
+ (void) strlcpy(fullname, p, sizeof fullname);
+ (void) strlcat(fullname, "/", sizeof fullname);
+ (void) strlcat(fullname, name, sizeof fullname);
/*
** Set doaccess if '.' (as in "../") shows up in name.
*/
@@ -972,7 +972,7 @@ tzset_basic P((void))
return;
lcl_is_set = strlen(name) < sizeof lcl_TZname;
if (lcl_is_set)
- (void) strcpy(lcl_TZname, name);
+ (void) strlcpy(lcl_TZname, name, sizeof lcl_TZname);
#ifdef ALL_STATE
if (lclptr == NULL) {
@@ -993,7 +993,7 @@ tzset_basic P((void))
lclptr->ttis[0].tt_isdst = 0;
lclptr->ttis[0].tt_gmtoff = 0;
lclptr->ttis[0].tt_abbrind = 0;
- (void) strcpy(lclptr->chars, gmt);
+ (void) strlcpy(lclptr->chars, gmt, sizeof lclptr->chars);
} else if (tzload(name, lclptr) != 0)
if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0)
(void) gmtload(lclptr);