From 50f99331097302f77db413ba7ad7299d928163eb Mon Sep 17 00:00:00 2001 From: lukem Date: Fri, 10 Oct 1997 16:32:15 +0000 Subject: 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() --- hunt/huntd/get_names.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'hunt/huntd/get_names.c') 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 +#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 +# include # include # include +# include +# include "hunt.h" # include "talk_ctl.h" -# include -# include 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)); -- cgit v1.2.3