aboutsummaryrefslogtreecommitdiffstats
path: root/KAME/getnameinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'KAME/getnameinfo.c')
-rw-r--r--KAME/getnameinfo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/KAME/getnameinfo.c b/KAME/getnameinfo.c
index 9549600c..fb97530e 100644
--- a/KAME/getnameinfo.c
+++ b/KAME/getnameinfo.c
@@ -71,7 +71,9 @@
#include <stddef.h>
#include <errno.h>
+#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
+#endif
#include "fetchmail.h"
#include "getaddrinfo.h"
@@ -284,9 +286,16 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
}
#endif
default:
+#ifdef HAVE_INET_NTOP
if (inet_ntop(afd->a_af, addr, host,
hostlen) == NULL)
return EAI_SYSTEM;
+#else
+ if (afd->a_af == AF_INET)
+ strlcpy(host, inet_ntoa(addr), hostlen);
+ else
+ return EAI_FAMILY;
+#endif
break;
}
}