mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 16:34:37 +00:00
inet_pton: don't assume addr families don't exist
Address family 5 might exist on some crazy system like Haiku. Use `INT_MAX-1` as an unsupported address family.
This commit is contained in:
parent
33ea4aae37
commit
983979fa0d
@ -94,10 +94,7 @@ void test_core_posix__inet_pton(void)
|
||||
cl_assert(p_inet_pton(AF_INET, "10.foo.bar.1", &addr) == 0);
|
||||
|
||||
/* Test unsupported address families */
|
||||
cl_git_fail(p_inet_pton(12, "52.472", &addr)); /* AF_DECnet */
|
||||
cl_assert_equal_i(EAFNOSUPPORT, errno);
|
||||
|
||||
cl_git_fail(p_inet_pton(5, "315.124", &addr)); /* AF_CHAOS */
|
||||
cl_git_fail(p_inet_pton(INT_MAX-1, "52.472", &addr));
|
||||
cl_assert_equal_i(EAFNOSUPPORT, errno);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user