mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
src/3rdparty: Rework inet-ntop change to build on Windows
This commit is contained in:
parent
b8248d07e9
commit
6936364b3c
1 changed files with 2 additions and 3 deletions
5
src/3rdparty/zeek_inet_ntop.c
vendored
5
src/3rdparty/zeek_inet_ntop.c
vendored
|
@ -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
|
* Keep this in mind if you think this function should have been coded
|
||||||
* to use pointer overlays. All the world's not a VAX.
|
* 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[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")], *tp;
|
||||||
char tmp[tmp_size], *tp;
|
|
||||||
struct { int base, len; } best, cur;
|
struct { int base, len; } best, cur;
|
||||||
u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
|
u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
|
||||||
int i;
|
int i;
|
||||||
|
@ -148,7 +147,7 @@ zeek_inet_ntop6(const u_char *src, char *dst, socklen_t size)
|
||||||
/*
|
/*
|
||||||
* Format the result.
|
* Format the result.
|
||||||
*/
|
*/
|
||||||
int remaining = tmp_size;
|
int remaining = sizeof(tmp);
|
||||||
tp = tmp;
|
tp = tmp;
|
||||||
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
|
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
|
||||||
/* Are we inside the best run of 0x00's? */
|
/* Are we inside the best run of 0x00's? */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue