summaryrefslogtreecommitdiffstats
path: root/hunt/huntd/get_names.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-10 16:32:15 +0000
committerlukem <lukem@NetBSD.org>1997-10-10 16:32:15 +0000
commit50f99331097302f77db413ba7ad7299d928163eb (patch)
tree376410fecfef0c2ac47f5b4f0643e6a84a373cdc /hunt/huntd/get_names.c
parenta25e10613cc56cac1b954b119f757a272dee9bc8 (diff)
downloadbsdgames-darwin-50f99331097302f77db413ba7ad7299d928163eb.tar.gz
bsdgames-darwin-50f99331097302f77db413ba7ad7299d928163eb.zip
Yet Another Monster Commit:
- WARNSify - getopt returns -1 not EOF - select() uses an fd_set, not int/long; modify code to use FD_* et al instead of direct bitwise operations - in otto.c::look (renamed to ottolook() to prevent name clash), the case WEST section had a 'goto cont_east', instead of 'goto cont_west'. (picked up by WARNS=1, because cont_west was an unused label because of this typo). probably meant that otto got lost in the maze :-/ - deprecate register, convert bcmp() -> memcmp()
Diffstat (limited to 'hunt/huntd/get_names.c')
-rw-r--r--hunt/huntd/get_names.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/hunt/huntd/get_names.c b/hunt/huntd/get_names.c
index e8a101a0..2d1cbe4d 100644
--- a/hunt/huntd/get_names.c
+++ b/hunt/huntd/get_names.c
@@ -1,30 +1,36 @@
+/* $NetBSD: get_names.c,v 1.2 1997/10/10 16:33:35 lukem Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: get_names.c,v 1.2 1997/10/10 16:33:35 lukem Exp $");
+#endif /* not lint */
+
#include "bsd.h"
#if defined(TALK_43) || defined(TALK_42)
+# include <sys/param.h>
+# include <netdb.h>
# include <stdio.h>
# include <string.h>
+# include <unistd.h>
+# include "hunt.h"
# include "talk_ctl.h"
-# include <sys/param.h>
-# include <netdb.h>
extern CTL_MSG msg;
-struct hostent *gethostbyname();
-struct servent *getservbyname();
-
static char hostname[MAXHOSTNAMELEN];
char *my_machine_name;
/*
* Determine the local user and machine
*/
+void
get_local_name(my_name)
char *my_name;
{
@@ -75,6 +81,7 @@ get_local_name(my_name)
/*
* Determine the remote user and machine
*/
+int
get_remote_name(his_address)
char *his_address;
{
@@ -109,7 +116,7 @@ get_remote_name(his_address)
msg.r_name[NAME_SIZE - 1] = '\0';
/* if he is on the same machine, then simply copy */
- if (bcmp((char *) &his_machine_name, (char *) &my_machine_name,
+ if (memcmp((char *) &his_machine_name, (char *) &my_machine_name,
sizeof(his_machine_name)) == 0)
memcpy(&his_machine_addr, &my_machine_addr,
sizeof(his_machine_name));