summaryrefslogtreecommitdiff
path: root/ares_getnameinfo.c
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2006-10-25 14:16:01 +0000
committerGisle Vanem <gvanem@broadpark.no>2006-10-25 14:16:01 +0000
commit4df9c29084f27788d4867a9f094bdcecb3f21cfb (patch)
treee09683d9becf9fa109edceaa74af24417dd02cf6 /ares_getnameinfo.c
parentd4bc2387b5c2d831fa091185b974620cf46ab0f0 (diff)
downloadc-ares-4df9c29084f27788d4867a9f094bdcecb3f21cfb.tar.gz
c-ares-4df9c29084f27788d4867a9f094bdcecb3f21cfb.tar.bz2
c-ares-4df9c29084f27788d4867a9f094bdcecb3f21cfb.zip
Fixed "'x' might be used uninitialized in this function" warning.
Removed trailing whitespace.
Diffstat (limited to 'ares_getnameinfo.c')
-rw-r--r--ares_getnameinfo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c
index 0b12f38..73e537a 100644
--- a/ares_getnameinfo.c
+++ b/ares_getnameinfo.c
@@ -81,8 +81,8 @@ static char *ares_striendstr(const char *s1, const char *s2);
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
int flags, ares_nameinfo_callback callback, void *arg)
{
- struct sockaddr_in *addr;
- struct sockaddr_in6 *addr6;
+ struct sockaddr_in *addr = NULL;
+ struct sockaddr_in6 *addr6 = NULL;
struct nameinfo_query *niquery;
/* Verify the buffer size */
@@ -264,11 +264,11 @@ static char *lookup_service(unsigned short port, int flags,
char tmpbuf[4096];
if (port)
- {
+ {
if (flags & ARES_NI_NUMERICSERV)
sep = NULL;
else
- {
+ {
if (flags & ARES_NI_UDP)
proto = "udp";
else if (flags & ARES_NI_SCTP)
@@ -288,15 +288,15 @@ static char *lookup_service(unsigned short port, int flags,
#elif GETSERVBYPORT_R_ARGS == 4
if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0)
sep = NULL;
-#else
+#else
/* Lets just hope the OS uses TLS! */
sep = getservbyport(port, proto);
-#endif
-#else
+#endif
+#else
/* Lets just hope the OS uses TLS! */
sep = getservbyport(port, proto);
-#endif
- }
+#endif
+ }
if (sep && sep->s_name)
/* get service name */
strcpy(tmpbuf, sep->s_name);