summaryrefslogtreecommitdiffstats
path: root/lib/src/name.c
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-01-30 16:47:41 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-01-30 17:43:09 +0100
commit67371907c2433f5233d4a669a1c9176539e9928f (patch)
treeb4b5119c495fde382fc7c70d4398c943364c2372 /lib/src/name.c
parente5145b878f9de35676085409878a66899d2ee4f2 (diff)
[HICN-19] Add support for Windows 10 x64 for libhicn (lib)
Change-Id: I5109d5ce293265fca557c2ef952fcb1c13b9d816 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
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;