summaryrefslogtreecommitdiffstats
path: root/hunt/hunt/hunt.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2014-03-30 04:57:37 +0000
committerdholland <dholland@NetBSD.org>2014-03-30 04:57:37 +0000
commit571fdd8c925268b4be1b866ff8f96c140bfe0ef9 (patch)
tree33319240737d914b842de9bb4c6dcf86d8e9088c /hunt/hunt/hunt.c
parent3cb1d3cdd0f23cb0b6ffecb45143d260ad9010a5 (diff)
downloadbsdgames-darwin-571fdd8c925268b4be1b866ff8f96c140bfe0ef9.tar.gz
bsdgames-darwin-571fdd8c925268b4be1b866ff8f96c140bfe0ef9.tar.zst
bsdgames-darwin-571fdd8c925268b4be1b866ff8f96c140bfe0ef9.zip
I wish the socket API didn't require casts. Easy to mess them up.
Diffstat (limited to 'hunt/hunt/hunt.c')
-rw-r--r--hunt/hunt/hunt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c
index cc3a0c06..1a116d33 100644
--- a/hunt/hunt/hunt.c
+++ b/hunt/hunt/hunt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hunt.c,v 1.52 2014/03/30 04:40:50 dholland Exp $ */
+/* $NetBSD: hunt.c,v 1.53 2014/03/30 04:57:37 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.52 2014/03/30 04:40:50 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.53 2014/03/30 04:57:37 dholland Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -449,10 +449,10 @@ dump_scores(const struct sockaddr_storage *host, socklen_t hostlen)
printf("\n%s:\n", lookuphost(host, hostlen));
fflush(stdout);
- s = socket(SOCK_FAMILY, SOCK_STREAM, 0);
+ s = socket(host->ss_family, SOCK_STREAM, 0);
if (s < 0)
err(1, "socket");
- if (connect(s, (struct sockaddr *) &host, sizeof host) < 0)
+ if (connect(s, (const struct sockaddr *)host, hostlen) < 0)
err(1, "connect");
while ((cnt = read(s, buf, BUFSIZ)) > 0)
write(fileno(stdout), buf, cnt);