eef44dce364f565282ead6c2dcd536ddcf426c62
[libc-test] / src / regression / inet_pton-empty-last-field.c
1 // '0' last field in an ipv6 address cannot be abbreviated to ::
2 #include <string.h>
3 #include <arpa/inet.h>
4 #include "test.h"
5
6 int main(void)
7 {
8         unsigned char buf[16];
9         char addr[] = "1:2:3:4:5:6:7::";
10
11         if (inet_pton(AF_INET6, addr, buf)) {
12                 t_error("inet_pton(%s) returned %x:%x:%x:%x:%x:%x:%x:%x, wanted a failure\n",
13                         addr, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
14         }
15         return t_status;
16 }