summaryrefslogtreecommitdiff
path: root/usr.bin/checknr
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-03 22:09:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-03 22:09:05 +0000
commit9670f53b3946db4342a92486e3bfb8767fcf3ece (patch)
tree0de028bd962c7b7e45b5f37685556dcc02a35864 /usr.bin/checknr
parent21b7f925dce7c90a089e57d6cae94fb179fa43c8 (diff)
kill strcpy; miod ok
Diffstat (limited to 'usr.bin/checknr')
-rw-r--r--usr.bin/checknr/checknr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index 4ced281a7fd..c0ce8aaf1a3 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checknr.c,v 1.7 2001/11/19 19:02:13 mpech Exp $ */
+/* $OpenBSD: checknr.c,v 1.8 2003/04/03 22:09:04 deraadt Exp $ */
/* $NetBSD: checknr.c,v 1.4 1995/03/26 04:10:19 glass Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: checknr.c,v 1.7 2001/11/19 19:02:13 mpech Exp $";
+static char rcsid[] = "$OpenBSD: checknr.c,v 1.8 2003/04/03 22:09:04 deraadt Exp $";
#endif
#endif /* not lint */
@@ -582,8 +582,7 @@ printf("binsrch(%s) -> %d\n", mac, slot);
dest = src+1;
while (dest > loc)
*dest-- = *src--;
- *loc = malloc(3);
- strcpy(*loc, mac);
+ *loc = strdup(mac);
ncmds++;
#ifdef DEBUG
printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds);