summaryrefslogtreecommitdiff
path: root/regress/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-28 08:06:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-28 08:06:48 +0000
commitdaf28bb440e812ec8e982dc8405151d33e4a2390 (patch)
tree3e3ca7917a86d23e07e431c2e68c5519739b68fa /regress/lib/libc
parente622817be818274084ff548fad943fd57055611c (diff)
kill bad functions; some sort of ok from marc who is trying to confuse me
Diffstat (limited to 'regress/lib/libc')
-rw-r--r--regress/lib/libc/regex/main.c6
-rw-r--r--regress/lib/libc/regex/split.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/regress/lib/libc/regex/main.c b/regress/lib/libc/regex/main.c
index 02f4bd7cf25..fd092905faf 100644
--- a/regress/lib/libc/regex/main.c
+++ b/regress/lib/libc/regex/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.4 2003/07/31 21:48:03 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.5 2004/02/28 08:06:46 deraadt Exp $ */
/* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */
#include <stdio.h>
@@ -228,7 +228,7 @@ int opts; /* may not match f1 */
char f0copy[1000];
char f2copy[1000];
- strcpy(f0copy, f0);
+ strlcpy(f0copy, f0, sizeof f0copy);
re.re_endp = (opts&REG_PEND) ? f0copy + strlen(f0copy) : NULL;
fixstr(f0copy);
err = regcomp(&re, f0copy, opts);
@@ -252,7 +252,7 @@ int opts; /* may not match f1 */
return;
}
- strcpy(f2copy, f2);
+ strlcpy(f2copy, f2, sizeof f2copy);
fixstr(f2copy);
if (options('e', f1)&REG_STARTEND) {
diff --git a/regress/lib/libc/regex/split.c b/regress/lib/libc/regex/split.c
index 1e17a55b89e..f0f72c8b663 100644
--- a/regress/lib/libc/regex/split.c
+++ b/regress/lib/libc/regex/split.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: split.c,v 1.3 2003/07/31 21:48:03 deraadt Exp $ */
+/* $OpenBSD: split.c,v 1.4 2004/02/28 08:06:47 deraadt Exp $ */
/* $NetBSD: split.c,v 1.2 1995/04/20 22:39:57 cgd Exp $ */
#include <stdio.h>
@@ -160,11 +160,11 @@ char *argv[];
if (argc > 4)
for (n = atoi(argv[3]); n > 0; n--) {
- (void) strcpy(buf, argv[1]);
+ (void) strlcpy(buf, argv[1], sizeof buf);
}
else if (argc > 3)
for (n = atoi(argv[3]); n > 0; n--) {
- (void) strcpy(buf, argv[1]);
+ (void) strlcpy(buf, argv[1], sizeof buf);
(void) split(buf, fields, MNF, argv[2]);
}
else if (argc > 2)
@@ -286,7 +286,7 @@ regress()
register char *f;
for (n = 0; tests[n].str != NULL; n++) {
- (void) strcpy(buf, tests[n].str);
+ (void) strlcpy(buf, tests[n].str, sizeof buf);
fields[RNF] = NULL;
nf = split(buf, fields, RNF, tests[n].seps);
printit = 0;