summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-10-04 21:18:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-10-04 21:18:58 +0000
commitf0c904cb678de2f7d5ee31b27fdb83a133a6e69e (patch)
tree617ecbfecb92ceb1b7fda0bf1e992c324c73b3c7 /usr.bin
parentd752c8f5258ba7bdfe862075a78e1ea22c60b9cb (diff)
tweaks from andrushock@korovino.net
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/route.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index a7f842bae75..902b976041b 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.57 2003/10/03 21:22:32 itojun Exp $ */
+/* $OpenBSD: route.c,v 1.58 2003/10/04 21:18:57 deraadt Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: route.c,v 1.57 2003/10/03 21:22:32 itojun Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.58 2003/10/04 21:18:57 deraadt Exp $";
#endif
#endif /* not lint */
@@ -73,7 +73,6 @@ static char *rcsid = "$OpenBSD: route.c,v 1.57 2003/10/03 21:22:32 itojun Exp $"
#define INET
#endif
-#include <sys/socket.h>
#include <netinet/ip_ipsp.h>
#include "netstat.h"
@@ -395,10 +394,8 @@ ntreestuff(void)
perror("route-sysctl-estimate");
exit(1);
}
- if ((buf = malloc(needed)) == 0) {
- printf("out of space\n");
- exit(1);
- }
+ if ((buf = malloc(needed)) == NULL)
+ errx(1, NULL);
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
perror("sysctl of routing table");
exit(1);