summaryrefslogtreecommitdiffstats
path: root/hunt/huntd
diff options
context:
space:
mode:
authorapb <apb@NetBSD.org>2014-03-28 17:49:11 +0000
committerapb <apb@NetBSD.org>2014-03-28 17:49:11 +0000
commit8ea01d526182cefb360ddd48824173e32ee2b5f8 (patch)
tree617a05fb1e1842c188b5fc7451ee9ffbc839e45b /hunt/huntd
parentc2765d33e91be2ea6d9a7dd12d8ea24ff4c62654 (diff)
downloadbsdgames-darwin-8ea01d526182cefb360ddd48824173e32ee2b5f8.tar.gz
bsdgames-darwin-8ea01d526182cefb360ddd48824173e32ee2b5f8.tar.zst
bsdgames-darwin-8ea01d526182cefb360ddd48824173e32ee2b5f8.zip
If you are going to use memcpy instead of struct assignment, then at
least use sizeof(the correct variable). The use of memcmp to test two pointers for equality, one line earlier, is also weird but may be correct.
Diffstat (limited to 'hunt/huntd')
-rw-r--r--hunt/huntd/get_names.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hunt/huntd/get_names.c b/hunt/huntd/get_names.c
index 832635fd..89601386 100644
--- a/hunt/huntd/get_names.c
+++ b/hunt/huntd/get_names.c
@@ -1,4 +1,4 @@
-/* $NetBSD: get_names.c,v 1.10 2009/07/04 04:29:55 dholland Exp $ */
+/* $NetBSD: get_names.c,v 1.11 2014/03/28 17:49:11 apb 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: get_names.c,v 1.10 2009/07/04 04:29:55 dholland Exp $");
+__RCSID("$NetBSD: get_names.c,v 1.11 2014/03/28 17:49:11 apb Exp $");
#endif /* not lint */
#include "bsd.h"
@@ -146,7 +146,7 @@ get_remote_name(char *his_address)
if (memcmp(&his_machine_name, &my_machine_name,
sizeof(his_machine_name)) == 0)
memcpy(&his_machine_addr, &my_machine_addr,
- sizeof(his_machine_name));
+ sizeof(his_machine_addr));
else {
/* look up the address of the recipient's machine */
hp = gethostbyname(his_machine_name);