summaryrefslogtreecommitdiff
path: root/usr.bin/nc
diff options
context:
space:
mode:
authorEric Jackson <ericj@cvs.openbsd.org>2001-08-25 21:50:14 +0000
committerEric Jackson <ericj@cvs.openbsd.org>2001-08-25 21:50:14 +0000
commitab1d7a2717833d8c2829339059cfe38422f0ca31 (patch)
treecd2f79ddf35affd26483c14303f65d6525067fa8 /usr.bin/nc
parent05489f37025413b766ed5e028bafab4baae4b84f (diff)
use calloc
Diffstat (limited to 'usr.bin/nc')
-rw-r--r--usr.bin/nc/netcat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index 3b3ae360a1a..7bd88ad6818 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.32 2001/08/02 21:00:14 ericj Exp $ */
+/* $OpenBSD: netcat.c,v 1.33 2001/08/25 21:50:13 ericj Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
*
@@ -518,7 +518,7 @@ build_ports(p)
/* Load ports sequentially */
for (cp = lo; cp <= hi; cp++) {
- portlist[x] = malloc(sizeof(PORT_MAX));
+ portlist[x] = calloc(1, PORT_MAX);
sprintf(portlist[x], "%d", cp);
x++;
}
@@ -539,7 +539,7 @@ build_ports(p)
hi = (int)strtoul(p, &endp, 10);
if (hi <= 0 || hi > PORT_MAX || *endp != '\0')
errx(1, "port range not valid");
- portlist[0] = malloc(sizeof(PORT_MAX));
+ portlist[0] = calloc(1, PORT_MAX);
portlist[0] = p;
}
}