summaryrefslogtreecommitdiffstats
path: root/fake-getaddrinfo.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-08 17:48:56 +1000
committerDamien Miller <djm@mindrot.org>2000-04-08 17:48:56 +1000
commitbc7c7cceea205733e3d0902bc751009b5836ff9c (patch)
tree879d315a66bc070c2410ee9da19b93780be517d1 /fake-getaddrinfo.c
parent73a26627f255088b55172f7947c8c2419634059b (diff)
- Avoid some compiler warnings in fake-get*.c
- Add IPTOS macros for systems which lack them
Diffstat (limited to 'fake-getaddrinfo.c')
-rw-r--r--fake-getaddrinfo.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fake-getaddrinfo.c b/fake-getaddrinfo.c
index b918798c..456c41e5 100644
--- a/fake-getaddrinfo.c
+++ b/fake-getaddrinfo.c
@@ -41,7 +41,7 @@ struct addrinfo *ai;
do {
next = ai->ai_next;
free(ai);
- } while (ai = next);
+ } while (NULL != (ai = next));
}
#endif /* !HAVE_FREEADDRINFO */
@@ -53,8 +53,8 @@ u_long addr;
{
struct addrinfo *ai;
- if (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) +
- sizeof(struct sockaddr_in))) {
+ if (NULL != (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) +
+ sizeof(struct sockaddr_in)))) {
memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
ai->ai_addr = (struct sockaddr *)(ai + 1);
/* XXX -- ssh doesn't use sa_len */
@@ -83,25 +83,25 @@ struct addrinfo **res;
else
port = 0;
if (hints && hints->ai_flags & AI_PASSIVE)
- if (*res = malloc_ai(port, htonl(0x00000000)))
+ if (NULL != (*res = malloc_ai(port, htonl(0x00000000))))
return 0;
else
return EAI_MEMORY;
if (!hostname)
- if (*res = malloc_ai(port, htonl(0x7f000001)))
+ if (NULL != (*res = malloc_ai(port, htonl(0x7f000001))))
return 0;
else
return EAI_MEMORY;
if (inet_addr(hostname) != -1)
- if (*res = malloc_ai(port, inet_addr(hostname)))
+ if (NULL != (*res = malloc_ai(port, inet_addr(hostname))))
return 0;
else
return EAI_MEMORY;
if ((hp = gethostbyname(hostname)) &&
hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
for (i = 0; hp->h_addr_list[i]; i++)
- if (cur = malloc_ai(port,
- ((struct in_addr *)hp->h_addr_list[i])->s_addr)) {
+ if (NULL != (cur = malloc_ai(port,
+ ((struct in_addr *)hp->h_addr_list[i])->s_addr))) {
if (prev)
prev->ai_next = cur;
else