blob: 9573514ce5275c5f2bf941f4bae7d214a8541cd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
$NetBSD: patch-ad,v 1.2 2000/05/31 15:32:44 itojun Exp $
--- fake-getnameinfo.c- Wed May 31 18:50:37 2000
+++ fake-getnameinfo.c Wed May 31 18:51:02 2000
@@ -37,25 +37,27 @@
else
strcpy(serv, tmpserv);
}
- if (host)
- if (flags & NI_NUMERICHOST)
+ if (host) {
+ if (flags & NI_NUMERICHOST) {
if (strlen(inet_ntoa(sin->sin_addr)) > hostlen)
return EAI_MEMORY;
else {
strcpy(host, inet_ntoa(sin->sin_addr));
return 0;
}
- else
+ } else {
if (NULL != (hp = gethostbyaddr((char *)&sin->sin_addr,
- sizeof(struct in_addr), AF_INET)))
+ sizeof(struct in_addr), AF_INET))) {
if (strlen(hp->h_name) > hostlen)
return EAI_MEMORY;
else {
strcpy(host, hp->h_name);
return 0;
}
- else
+ } else
return EAI_NODATA;
+ }
+ }
return 0;
}
#endif /* !HAVE_GETNAMEINFO */
|