src/3rdparty: Rework inet-ntop change to build on Windows

This commit is contained in:
Tim Wojtulewicz 2023-02-12 13:42:05 -07:00 committed by Tim Wojtulewicz
parent b8248d07e9
commit 6936364b3c

View file

@ -106,8 +106,7 @@ zeek_inet_ntop6(const u_char *src, char *dst, socklen_t size)
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
const int tmp_size = sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255");
char tmp[tmp_size], *tp;
char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")], *tp;
struct { int base, len; } best, cur;
u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
int i;
@ -148,7 +147,7 @@ zeek_inet_ntop6(const u_char *src, char *dst, socklen_t size)
/*
* Format the result.
*/
int remaining = tmp_size;
int remaining = sizeof(tmp);
tp = tmp;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
/* Are we inside the best run of 0x00's? */