summaryrefslogtreecommitdiff
path: root/inet
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-09-18 19:57:24 +0000
committerJakub Jelinek <jakub@redhat.com>2007-09-18 19:57:24 +0000
commit7913ba4d91b848ec4e5698c59d43198a3ef9215d (patch)
treeafc73f6e0376ae6d07526c5efa9e941641ce1f6d /inet
parentcedf9b89dd3b436ff7fad4c75d3f288ee4cd4ecd (diff)
Updated to fedora-glibc-20070918T1931cvs/fedora-glibc-2_6_90-14
Diffstat (limited to 'inet')
-rw-r--r--inet/inet_net.c2
-rw-r--r--inet/tst-network.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/inet/inet_net.c b/inet/inet_net.c
index e9331c5926..d58f1ae8e3 100644
--- a/inet/inet_net.c
+++ b/inet/inet_net.c
@@ -55,7 +55,7 @@ again:
if (*cp == '0')
digit = 1, base = 8, cp++;
if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
+ digit = 0, base = 16, cp++;
while ((c = *cp) != 0) {
if (isdigit(c)) {
if (base == 8 && (c == '8' || c == '9'))
diff --git a/inet/tst-network.c b/inet/tst-network.c
index 4283888057..5491740e37 100644
--- a/inet/tst-network.c
+++ b/inet/tst-network.c
@@ -34,7 +34,10 @@ struct
{"1.0", 0x100},
{"1", 0x1},
{"192.168.0.0", 0xC0A80000},
+ {"0", 0},
+ {"0x0", 0},
/* Now some invalid addresses. */
+ {"0x", INADDR_NONE},
{"141.30.225.2800", INADDR_NONE},
{"141.76.1.1.1", INADDR_NONE},
{"141.76.1.11.", INADDR_NONE},
@@ -61,6 +64,7 @@ main (void)
if (res != tests[i].number)
{
+ ++errors;
printf ("Test failed for inet_network (\"%s\"):\n",
tests[i].network);
printf ("Expected return value %u (0x%x) but got %u (0x%x).\n",