aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-04-30 14:07:17 +0000
committerUlrich Drepper <drepper@redhat.com>1999-04-30 14:07:17 +0000
commit6df34c4b46a2ab809b9196c92f23fc82e116c231 (patch)
tree867127b4437122f8d446fdf584942de568d8b435 /nss/digits_dots.c
parent1999-04-30 Roland McGrath <roland@baalperazim.frob.com> (diff)
downloadglibc-6df34c4b46a2ab809b9196c92f23fc82e116c231.tar.gz
glibc-6df34c4b46a2ab809b9196c92f23fc82e116c231.tar.bz2
glibc-6df34c4b46a2ab809b9196c92f23fc82e116c231.zip
Improve last change a bit.
Diffstat (limited to 'nss/digits_dots.c')
-rw-r--r--nss/digits_dots.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/nss/digits_dots.c b/nss/digits_dots.c
index 06f91fe691..ecc49c1c27 100644
--- a/nss/digits_dots.c
+++ b/nss/digits_dots.c
@@ -103,21 +103,16 @@
if (*--cp == '.')
break;
- /* All-numeric, no dot at the end. Fake up a hostent as if
- we'd actually done a lookup. What if someone types
- 255.255.255.255? The test below will succeed
- spuriously... ??? */
- switch (af)
+ /* All-numeric, no dot at the end. Fake up a hostent as if
+ we'd actually done a lookup. What if someone types
+ 255.255.255.255? The test below will succeed
+ spuriously... ??? */
+ if (af == AF_INET)
+ not_ok = inet_aton (name, (struct in_addr *) host_addr);
+ else
{
- case AF_INET:
- not_ok = inet_aton (name, (struct in_addr *) host_addr);
- break;
- case AF_INET6:
+ assert (af == AF_INET6);
not_ok = (inet_pton (af, name, host_addr) <= 0);
- break;
- default:
- assert (! "There should be no other `af' value");
- not_ok = 1;
}
if (not_ok)
{