Blame SOURCES/0001-examples-avoid-using-inet_ntoa.patch

b94532
From 4097c1b862eb59f7110d097df7f719d00869191d Mon Sep 17 00:00:00 2001
b94532
Message-Id: <4097c1b862eb59f7110d097df7f719d00869191d.1624267112.git.davide.caratti@gmail.com>
b94532
From: Davide Caratti <davide.caratti@gmail.com>
b94532
Date: Wed, 16 Jun 2021 21:22:15 +0200
b94532
Subject: [PATCH 1/2] examples: avoid using inet_ntoa()
b94532
b94532
---
b94532
 examples/https-server-test.c | 5 +++--
b94532
 1 file changed, 3 insertions(+), 2 deletions(-)
b94532
b94532
diff --git a/examples/https-server-test.c b/examples/https-server-test.c
b94532
index 6362722..b626fd2 100644
b94532
--- a/examples/https-server-test.c
b94532
+++ b/examples/https-server-test.c
b94532
@@ -199,12 +199,13 @@ int main(int argc, char *argv[])
b94532
 			https_tls_ready, https_tls_disconnected, NULL);
b94532
 
b94532
 	if (getenv("TLS_DEBUG")) {
b94532
+		char buf[INET_ADDRSTRLEN];
b94532
 		char *str;
b94532
 
b94532
 		l_tls_set_debug(tls, https_tls_debug_cb, NULL, NULL);
b94532
 
b94532
-		str = l_strdup_printf("/tmp/ell-certchain-%s.pem",
b94532
-					inet_ntoa(client_addr.sin_addr));
b94532
+		inet_ntop(AF_INET,&client_addr.sin_addr, buf, INET_ADDRSTRLEN);
b94532
+		str = l_strdup_printf("/tmp/ell-certchain-%s.pem", buf);
b94532
 		l_tls_set_cert_dump_path(tls, str);
b94532
 		l_free(str);
b94532
 	}
b94532
-- 
b94532
2.31.1
b94532