summaryrefslogtreecommitdiff
path: root/whois.c
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2014-10-15 15:03:13 +0200
committerMarco d'Itri <md@linux.it>2014-10-15 15:19:12 +0200
commit45bdfcc27c550902b21e6bbbdd20b80eb211d378 (patch)
tree04c490c6d760eb00f3dee5bf8df90a9ba7d78419 /whois.c
parent3ad4f437351340cf1c1faada80d01f886202ca58 (diff)
downloadwhois-45bdfcc27c550902b21e6bbbdd20b80eb211d378.tar.gz
Convert convert_inaddr() to in_domain()
Diffstat (limited to 'whois.c')
-rw-r--r--whois.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/whois.c b/whois.c
index 3e454ca..0e7f6b8 100644
--- a/whois.c
+++ b/whois.c
@@ -1261,17 +1261,17 @@ char *convert_inaddr(const char *s)
if (errno || a < 0 || a > 255 || *endptr != '.')
return strdup("0.0.0.0");
- if (domcmp(endptr + 1, ".in-addr.arpa")) {
+ if (in_domain(endptr + 1, "in-addr.arpa")) {
b = strtol(endptr + 1, &endptr, 10); /* 1.2. */
if (errno || b < 0 || b > 255 || *endptr != '.')
return strdup("0.0.0.0");
- if (domcmp(endptr + 1, ".in-addr.arpa")) {
+ if (in_domain(endptr + 1, "in-addr.arpa")) {
c = strtol(endptr + 1, &endptr, 10); /* 1.2.3. */
if (errno || c < 0 || c > 255 || *endptr != '.')
return strdup("0.0.0.0");
- if (domcmp(endptr + 1, ".in-addr.arpa"))
+ if (in_domain(endptr + 1, "in-addr.arpa"))
return strdup("0.0.0.0");
} else {
c = b; b = a; a = 0;