From 319f120d85d20dc0aa2d2bfab2c9da9b99eec64a Mon Sep 17 00:00:00 2001 From: ericj <> Date: Sat, 25 Aug 2001 21:50:13 +0000 Subject: use calloc --- src/usr.bin/nc/netcat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 3b3ae360a1..7bd88ad681 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/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 * @@ -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; } } -- cgit v1.2.3-55-g6feb