summaryrefslogtreecommitdiff
path: root/lib/inet_ntop.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inet_ntop.c')
-rw-r--r--lib/inet_ntop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index a05689adb..1fdcb2ebe 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -69,7 +69,12 @@ static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size)
return (char *)memmove(dst, ptr, strlen(ptr)+1);
#elif defined(HAVE_INET_NTOA_R)
+
+#if defined(HAVE_INT_INET_NTOA_R)
+ return inet_ntoa_r(*(struct in_addr*)src, dst, size)? NULL: dst;
+#else
return inet_ntoa_r(*(struct in_addr*)src, dst, size);
+#endif
#else
const char *addr = inet_ntoa(*(struct in_addr*)src);