diff --git a/src/regression/inet_pton-invalid-address.c b/src/regression/inet_pton-invalid-address.c new file mode 100644 index 0000000..7f181f4 --- /dev/null +++ b/src/regression/inet_pton-invalid-address.c @@ -0,0 +1,14 @@ +// inet_pton should return 0 on invalid address format +#include +#include +#include "test.h" + +int main(void) +{ + int r; + char addr[16]; + + if ((r=inet_pton(AF_INET6, "192.168.1.1", addr)) != 0) + t_error("inet_pton(AF_INET6, \"192.168.1.1\", addr) should return 0, got %d\n", r); + return t_status; +}