summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/resolve/Makefile.in2
-rw-r--r--src/tests/resolve/addrinfo-test.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/tests/resolve/Makefile.in b/src/tests/resolve/Makefile.in
index 2f0815607..f999772b7 100644
--- a/src/tests/resolve/Makefile.in
+++ b/src/tests/resolve/Makefile.in
@@ -16,7 +16,7 @@ resolve: resolve.o
$(CC_LINK) -o $@ resolve.o $(LIBS)
addrinfo-test: addrinfo-test.o
- $(CC_LINK) -o $@ addrinfo-test.o $(LIBS)
+ $(CC_LINK) -o $@ addrinfo-test.o $(SUPPORT_LIB) $(LIBS)
fake-addrinfo-test: fake-addrinfo-test.o
$(CC_LINK) -o $@ fake-addrinfo-test.o $(SUPPORT_LIB) $(LIBS)
diff --git a/src/tests/resolve/addrinfo-test.c b/src/tests/resolve/addrinfo-test.c
index 35fb0731d..42e4dd62a 100644
--- a/src/tests/resolve/addrinfo-test.c
+++ b/src/tests/resolve/addrinfo-test.c
@@ -44,6 +44,7 @@
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h> /* needed for IPPROTO_* on NetBSD */
+#include <k5-platform.h>
#ifdef USE_FAKE_ADDRINFO
#include "fake-addrinfo.h"
#endif
@@ -284,8 +285,10 @@ int main (int argc, char *argv[])
ap2->ai_addr->sa_family = ap2->ai_family;
}
if (getnameinfo(ap2->ai_addr, ap2->ai_addrlen, hbuf, sizeof(hbuf),
- pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV))
- strcpy(hbuf, "..."), strcpy(pbuf, "...");
+ pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV)) {
+ strlcpy(hbuf, "...", sizeof(hbuf));
+ strlcpy(pbuf, "...", sizeof(pbuf));
+ }
printf("%p:\n"
"\tfamily = %s\tproto = %-4s\tsocktype = %s\n",
ap2, familyname(ap2->ai_family),