From 2615528ba07b91cd3a35b974e9163fa3d8bab5e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20Salvet?= Date: Thu, 25 Mar 2010 06:06:22 +0000 Subject: [PATCH] Missing part of previous fix. --- org.glite.security.gss/test/test_gss.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.glite.security.gss/test/test_gss.cpp b/org.glite.security.gss/test/test_gss.cpp index 90ec6d3..5eafe78 100644 --- a/org.glite.security.gss/test/test_gss.cpp +++ b/org.glite.security.gss/test/test_gss.cpp @@ -23,6 +23,7 @@ limitations under the License. #include #include #include +#include #include #include @@ -95,6 +96,7 @@ void GSSTest::setUp(void) { struct addrinfo *ai; struct addrinfo hints; char servname[16]; + int ret; timeout.tv_sec = to ? atoi(to) : 10 ; @@ -111,7 +113,8 @@ void GSSTest::setUp(void) { hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE | AI_ADDRCONFIG; hints.ai_socktype = SOCK_STREAM; - ret = getaddrinfo (NULL, port, &hints, &ai); + snprintf(servname, sizeof servname, "%d", port); + ret = getaddrinfo (NULL, servname, &hints, &ai); CPPUNIT_ASSERT_MESSAGE("getaddrinfo()", ret == 0 && ai != NULL); sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); -- 1.8.2.3