diff --git a/src/isinetaddr.c b/src/isinetaddr.c index 8e3358e..a2582ea 100644 --- a/src/isinetaddr.c +++ b/src/isinetaddr.c @@ -17,7 +17,7 @@ isinetaddr(const char *str) for (size_t l = 0; l < len; l++) { if (str[l] == '.') { - if (octets == 2 && digits == 0) { + if (buflen == 0) { return 0; } else if (!in_range(buf, buflen)) { return 0; diff --git a/test/isinetaddr_test.c b/test/isinetaddr_test.c index c5e43e2..d5b752c 100644 --- a/test/isinetaddr_test.c +++ b/test/isinetaddr_test.c @@ -25,6 +25,7 @@ const char *invalid[] = { ".......", "192.2.2.", "...4", + "4...4", NULL };