summaryrefslogtreecommitdiffstats
path: root/hunt
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2014-03-29 20:53:55 +0000
committerdholland <dholland@NetBSD.org>2014-03-29 20:53:55 +0000
commit32a54d49158271df4ffa0cf4422f612647973022 (patch)
tree6254e5e3fa44cbab7129b52a41cfc27c835daf56 /hunt
parent589e02daba1868696c35cf56be2e1faef05cbd55 (diff)
downloadbsdgames-darwin-32a54d49158271df4ffa0cf4422f612647973022.tar.gz
bsdgames-darwin-32a54d49158271df4ffa0cf4422f612647973022.tar.zst
bsdgames-darwin-32a54d49158271df4ffa0cf4422f612647973022.zip
Remove unsafe and unnecessary pointer casts.
Diffstat (limited to 'hunt')
-rw-r--r--hunt/hunt/hunt.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c
index 23cb7003..6f1cab08 100644
--- a/hunt/hunt/hunt.c
+++ b/hunt/hunt/hunt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hunt.c,v 1.42 2014/03/29 20:52:13 dholland Exp $ */
+/* $NetBSD: hunt.c,v 1.43 2014/03/29 20:53:55 dholland Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.42 2014/03/29 20:52:13 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.43 2014/03/29 20:53:55 dholland Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -99,7 +99,7 @@ static void sigterm(int) __dead;
static void sigusr1(int) __dead;
static void find_driver(bool);
static void start_driver(void);
-static int broadcast_vec(int, struct sockaddr **);
+static int broadcast_vec(int, struct sockaddr_in **);
#ifdef INTERNET
static SOCKET *list_drivers(void);
#endif
@@ -337,7 +337,7 @@ main(int ac, char **av)
#ifdef INTERNET
static int
-broadcast_vec(int s /*socket*/, struct sockaddr **vector)
+broadcast_vec(int s /*socket*/, struct sockaddr_in **vector)
{
int vec_cnt;
struct ifaddrs *ifp, *ip;
@@ -352,8 +352,7 @@ broadcast_vec(int s /*socket*/, struct sockaddr **vector)
(ip->ifa_flags & IFF_BROADCAST))
vec_cnt++;
- *vector = (struct sockaddr *)
- malloc(vec_cnt * sizeof(struct sockaddr_in));
+ *vector = malloc(vec_cnt * sizeof(struct sockaddr_in));
vec_cnt = 0;
for (ip = ifp; ip; ip = ip->ifa_next)
@@ -432,7 +431,7 @@ list_drivers(void)
}
if (initial)
- brdc = broadcast_vec(test_socket, (void *) &brdv);
+ brdc = broadcast_vec(test_socket, &brdv);
#ifdef SO_BROADCAST
/* Sun's will broadcast even though this option can't be set */