All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davide Caratti <davide.caratti@gmail.com>
To: ell@lists.01.org
Subject: [PATCH 2/2] examples: avoid using inet_ntoa()
Date: Wed, 16 Jun 2021 21:22:15 +0200	[thread overview]
Message-ID: <fb5f207d58299b01ef358503897507be9cc21fe0.1623871292.git.davide.caratti@gmail.com> (raw)
In-Reply-To: <144affac0389b92896ae152643610b6ec497a398.1623871292.git.davide.caratti@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

---
 examples/https-server-test.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/https-server-test.c b/examples/https-server-test.c
index 6362722..b626fd2 100644
--- a/examples/https-server-test.c
+++ b/examples/https-server-test.c
@@ -199,12 +199,13 @@ int main(int argc, char *argv[])
 			https_tls_ready, https_tls_disconnected, NULL);
 
 	if (getenv("TLS_DEBUG")) {
+		char buf[INET_ADDRSTRLEN];
 		char *str;
 
 		l_tls_set_debug(tls, https_tls_debug_cb, NULL, NULL);
 
-		str = l_strdup_printf("/tmp/ell-certchain-%s.pem",
-					inet_ntoa(client_addr.sin_addr));
+		inet_ntop(AF_INET,&client_addr.sin_addr, buf, INET_ADDRSTRLEN);
+		str = l_strdup_printf("/tmp/ell-certchain-%s.pem", buf);
 		l_tls_set_cert_dump_path(tls, str);
 		l_free(str);
 	}
-- 
2.31.1

  reply	other threads:[~2021-06-16 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 19:22 [PATCH 1/2] ell: " Davide Caratti
2021-06-16 19:22 ` Davide Caratti [this message]
2021-06-18 14:54 ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb5f207d58299b01ef358503897507be9cc21fe0.1623871292.git.davide.caratti@gmail.com \
    --to=davide.caratti@gmail.com \
    --cc=ell@lists.01.org \
    --subject='Re: [PATCH 2/2] examples: avoid using inet_ntoa()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.