summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorThierry Deval <tdeval@cvs.openbsd.org>2003-04-05 00:43:21 +0000
committerThierry Deval <tdeval@cvs.openbsd.org>2003-04-05 00:43:21 +0000
commit28816b14035bb08ad1d134a6d059b038e14eb7d8 (patch)
tree4cdd8655a357f40d8bfa4e236e802ffeb3ec3969 /lib/libc
parent89818c6c69a0745284f6b5368cadd229bfe9c8cb (diff)
strcpy/strcat -> strlcpy/strlcat
ok tedu@, hints by deraadt@ and millert@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/getnetnamadr.c7
-rw-r--r--lib/libc/regex/regcomp.c5
-rw-r--r--lib/libc/time/zdump.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c
index 75a75243efd..1be874209f2 100644
--- a/lib/libc/net/getnetnamadr.c
+++ b/lib/libc/net/getnetnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr.c,v 1.20 2003/01/28 04:58:00 marc Exp $ */
+/* $OpenBSD: getnetnamadr.c,v 1.21 2003/04/05 00:43:19 tdeval Exp $ */
/*
* Copyright (c) 1997, Jason Downs. All rights reserved.
@@ -77,7 +77,7 @@ static char sccsid[] = "@(#)getnetbyaddr.c 8.1 (Berkeley) 6/4/93";
static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03";
static char rcsid[] = "$From: getnetnamadr.c,v 8.7 1996/08/05 08:31:35 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.20 2003/01/28 04:58:00 marc Exp $";
+static char rcsid[] = "$OpenBSD: getnetnamadr.c,v 1.21 2003/04/05 00:43:19 tdeval Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -242,8 +242,9 @@ getnetanswer(answer, anslen, net_i)
if (i != 0)
nchar++;
strlcpy(paux1, in, nchar+1);
+ strlcat(paux1, paux2, MAXHOSTNAMELEN);
pauxt = paux2;
- paux2 = strcat(paux1, paux2);
+ paux2 = paux1;
paux1 = pauxt;
in = ++st;
}
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 10224be9240..fc01ad0bb4b 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#else
-static char rcsid[] = "$OpenBSD: regcomp.c,v 1.8 2002/02/16 21:27:24 millert Exp $";
+static char rcsid[] = "$OpenBSD: regcomp.c,v 1.9 2003/04/05 00:43:20 tdeval Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -1285,8 +1285,7 @@ register char *cp;
}
cs->multis = np;
- (void) strcpy(cs->multis + oldend - 1, cp);
- cs->multis[cs->smultis - 1] = '\0';
+ strlcpy(cs->multis + oldend - 1, cp, cs->smultis - oldend + 1);
}
/*
diff --git a/lib/libc/time/zdump.c b/lib/libc/time/zdump.c
index 5b902cf5607..dd3f71b8e77 100644
--- a/lib/libc/time/zdump.c
+++ b/lib/libc/time/zdump.c
@@ -5,7 +5,7 @@
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
static char elsieid[] = "@(#)zdump.c 7.29";
-static char rcsid[] = "$OpenBSD: zdump.c,v 1.10 2003/02/14 18:24:53 millert Exp $";
+static char rcsid[] = "$OpenBSD: zdump.c,v 1.11 2003/04/05 00:43:20 tdeval Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -209,7 +209,7 @@ _("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
(void) exit(EXIT_FAILURE);
}
to = 0;
- (void) strcpy(fakeenv[to++], "TZ=");
+ strlcpy(fakeenv[to++], "TZ=", longest + 4);
for (from = 0; environ[from] != NULL; ++from)
if (strncmp(environ[from], "TZ=", 3) != 0)
fakeenv[to++] = environ[from];
@@ -219,7 +219,7 @@ _("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
for (i = optind; i < argc; ++i) {
static char buf[MAX_STRING_LENGTH];
- (void) strcpy(&fakeenv[0][3], argv[i]);
+ strlcpy(&fakeenv[0][3], argv[i], longest + 1);
if (!vflag) {
show(argv[i], now, FALSE);
continue;