fix functional/inet_pton (inet_ntop returns NULL on failure)
authorSzabolcs Nagy <nsz@port70.net>
Tue, 22 Oct 2013 03:08:02 +0000 (03:08 +0000)
committerSzabolcs Nagy <nsz@port70.net>
Tue, 22 Oct 2013 03:08:02 +0000 (03:08 +0000)
src/functional/inet_pton.c

index 188b68a..40910ff 100644 (file)
@@ -94,11 +94,10 @@ int main(void)
 if (inet_pton(12345, "", 0) != -1 || errno != EAFNOSUPPORT)
        t_error("inet_pton(12345,,) should fail with EAFNOSUPPORT, got %s\n", strerror(errno));
 errno=0;
-if (inet_ntop(AF_INET,"xxxx",0,0) != -1 || errno != ENOSPC)
+if (inet_ntop(AF_INET,"xxxx","",0) != 0 || errno != ENOSPC)
        t_error("inet_ntop(,,0,0) should fail with ENOSPC, got %s\n", strerror(errno));
 errno=0;
 
-
 // dotted-decimal notation
 V4("0.0.0.0", 1, "00000000")
 V4("127.0.0.1", 1, "7f000001")