summaryrefslogtreecommitdiffstats
path: root/lib/src/name.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/name.c')
-rw-r--r--lib/src/name.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/src/name.c b/lib/src/name.c
index 6e5711252..9e409bd3b 100644
--- a/lib/src/name.c
+++ b/lib/src/name.c
@@ -18,7 +18,9 @@
* @brief Implementation of hICN name helpers.
*/
+#ifndef _WIN32
#include <arpa/inet.h> // inet_ptin
+#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h> // strtoul
@@ -614,13 +616,13 @@ hicn_ip_pton (const char *ip_address_str, ip_address_t * ip_address)
if (dst_len > IPV6_ADDR_LEN_BITS)
goto ERR;
pton_fd = inet_pton (AF_INET6, addr, &ip_address->buffer);
- ip_address->prefix_len = dst_len ? : IPV6_ADDR_LEN_BITS;
+ ip_address->prefix_len = dst_len ? dst_len : IPV6_ADDR_LEN_BITS;
break;
case AF_INET:
if (dst_len > IPV4_ADDR_LEN_BITS)
goto ERR;
pton_fd = inet_pton (AF_INET, addr, &ip_address->buffer);
- ip_address->prefix_len = dst_len ? : IPV4_ADDR_LEN_BITS;
+ ip_address->prefix_len = dst_len ? dst_len : IPV4_ADDR_LEN_BITS;
break;
default:
goto ERR;