summaryrefslogtreecommitdiffstats
path: root/hunt/hunt
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-20 00:37:14 +0000
committerlukem <lukem@NetBSD.org>1997-10-20 00:37:14 +0000
commite0bdecd84aaeef731c9a77b4b2a8cc8aa4516b52 (patch)
tree3419c96043eeb5f76999e9317b523efc282cda54 /hunt/hunt
parent1a42f2efb90085739090202bc48bccbcb7a1acdb (diff)
downloadbsdgames-darwin-e0bdecd84aaeef731c9a77b4b2a8cc8aa4516b52.tar.gz
bsdgames-darwin-e0bdecd84aaeef731c9a77b4b2a8cc8aa4516b52.tar.zst
bsdgames-darwin-e0bdecd84aaeef731c9a77b4b2a8cc8aa4516b52.zip
FD_ZERO select mask before FD_SET-ing it
Diffstat (limited to 'hunt/hunt')
-rw-r--r--hunt/hunt/hunt.c5
-rw-r--r--hunt/hunt/playit.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c
index b7470590..08b492bc 100644
--- a/hunt/hunt/hunt.c
+++ b/hunt/hunt/hunt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hunt.c,v 1.3 1997/10/11 08:13:41 lukem Exp $ */
+/* $NetBSD: hunt.c,v 1.4 1997/10/20 00:37:14 lukem Exp $ */
/*
* Hunt
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.3 1997/10/11 08:13:41 lukem Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.4 1997/10/20 00:37:14 lukem Exp $");
#endif /* not lint */
# include <sys/stat.h>
@@ -508,6 +508,7 @@ get_response:
listmax * sizeof(SOCKET));
}
+ FD_ZERO(&mask);
FD_SET(test_socket, &mask);
if (select(test_socket + 1, &mask, NULL, NULL, &wait) == 1 &&
recvfrom(test_socket, (char *) &port_num, sizeof(port_num),
diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c
index 5d558aa2..53fd6b34 100644
--- a/hunt/hunt/playit.c
+++ b/hunt/hunt/playit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: playit.c,v 1.3 1997/10/11 08:13:44 lukem Exp $ */
+/* $NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $ */
/*
* Hunt
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: playit.c,v 1.3 1997/10/11 08:13:44 lukem Exp $");
+__RCSID("$NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $");
#endif /* not lint */
# include <sys/file.h>
@@ -220,6 +220,7 @@ getchr()
fd_set readfds, s_readfds;
int nfds, s_nfds;
+ FD_ZERO(&s_readfds);
FD_SET(Socket, &s_readfds);
FD_SET(STDIN, &s_readfds);
s_nfds = (Socket > STDIN) ? Socket : STDIN;