summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2000-03-13 02:22:12 +0000
committeritojun <itojun@openbsd.org>2000-03-13 02:22:12 +0000
commit3ecf48f8c9cc2dba8d73b2e0f7cb7dfb98ad2dfc (patch)
tree499dce5b1770fc8582bb4e62e6c96a9d5aa518c6
parentdon't process NI_NOFQDN, since the currently coded behavior is not specwise (diff)
downloadwireguard-openbsd-3ecf48f8c9cc2dba8d73b2e0f7cb7dfb98ad2dfc.tar.xz
wireguard-openbsd-3ecf48f8c9cc2dba8d73b2e0f7cb7dfb98ad2dfc.zip
avoid unused variable by #ifdef
-rw-r--r--lib/libc/net/getnameinfo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index 1eddbb0bf06..c174b8a7ea6 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo.c,v 1.11 2000/03/13 02:18:36 itojun Exp $ */
+/* $OpenBSD: getnameinfo.c,v 1.12 2000/03/13 02:22:12 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -105,7 +105,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
struct hostent *hp;
u_short port;
int family, i;
- char *addr, *p;
+ char *addr;
u_int32_t v4a;
int h_error;
char numserv[512];
@@ -268,8 +268,11 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
if (hp) {
#if 0
if (flags & NI_NOFQDN) {
+ char *p;
+
p = strchr(hp->h_name, '.');
- if (p) *p = '\0';
+ if (p)
+ *p = '\0';
}
#endif
if (strlen(hp->h_name) > hostlen) {