diff options
author | Yang Tse <yangsita@gmail.com> | 2010-11-16 19:08:07 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-11-16 19:08:07 +0100 |
commit | 690f9a726c20b1d0b4b4132b3d4110658f65e776 (patch) | |
tree | 869bc865a557a098ac0aecba90d39790ce2d74d2 /ares_getnameinfo.c | |
parent | 137a440a364eeb667cc07ae8acf1665a76dfce9f (diff) | |
download | c-ares-690f9a726c20b1d0b4b4132b3d4110658f65e776.tar.gz c-ares-690f9a726c20b1d0b4b4132b3d4110658f65e776.tar.bz2 c-ares-690f9a726c20b1d0b4b4132b3d4110658f65e776.zip |
ares_getnameinfo: fix two compiler warnings
Diffstat (limited to 'ares_getnameinfo.c')
-rw-r--r-- | ares_getnameinfo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c index 68c1dbf..fc95d3b 100644 --- a/ares_getnameinfo.c +++ b/ares_getnameinfo.c @@ -232,7 +232,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, char buf[255]; char *domain; gethostname(buf, 255); - if ((domain = strchr(buf, '.'))) + if ((domain = strchr(buf, '.')) != NULL) { char *end = ares_striendstr(host->h_name, domain); if (end) @@ -356,11 +356,11 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags, #ifdef HAVE_IF_INDEXTONAME int is_ll, is_mcll; #endif - char fmt_u[] = "%u"; - char fmt_lu[] = "%lu"; + static const char fmt_u[] = "%u"; + static const char fmt_lu[] = "%lu"; char tmpbuf[IF_NAMESIZE + 2]; size_t bufl; - char *fmt = (sizeof(addr6->sin6_scope_id) > sizeof(unsigned int))? + const char *fmt = (sizeof(addr6->sin6_scope_id) > sizeof(unsigned int))? fmt_lu:fmt_u; tmpbuf[0] = '%'; |