1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

xfer: fix conversion of string to IPv4 on 32-bit systems (issue #1999)

This commit is contained in:
Sébastien Helleu
2023-08-18 15:34:06 +02:00
parent 4fe1ba7016
commit 647d7033cf
3 changed files with 9 additions and 4 deletions
@@ -49,6 +49,9 @@ TEST(XferNetwork, ConvertIntegerToIpv4)
POINTERS_EQUAL(NULL, xfer_network_convert_integer_to_ipv4 ("0"));
POINTERS_EQUAL(NULL, xfer_network_convert_integer_to_ipv4 ("-1"));
/* too big: UINT32_MAX + 1 = 4294967296 */
POINTERS_EQUAL(NULL, xfer_network_convert_integer_to_ipv4 ("4294967296"));
WEE_TEST_STR("0.0.0.1", xfer_network_convert_integer_to_ipv4 ("1"));
WEE_TEST_STR("0.0.1.0", xfer_network_convert_integer_to_ipv4 ("256"));
WEE_TEST_STR("0.1.0.0", xfer_network_convert_integer_to_ipv4 ("65536"));