From a2a037a8211fd1bd7880df0ee2e8413843b7c3cf Mon Sep 17 00:00:00 2001 From: Norbert Pocs Date: Mon, 4 Jul 2022 10:08:28 +0200 Subject: [PATCH] Rewrite strerror to ssh_strerror Signed-off-by: Norbert Pocs Reviewed-by: Jakub Jelen --- src/pcap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pcap.c b/src/pcap.c index abac3cd0..9492df50 100644 --- a/src/pcap.c +++ b/src/pcap.c @@ -315,6 +315,7 @@ static int ssh_pcap_context_connect(ssh_pcap_context ctx) socket_t fd; socklen_t len; int rc; + char err_msg[SSH_ERRNO_MSG_MAX] = {0}; if (session == NULL) { return SSH_ERROR; @@ -337,7 +338,7 @@ static int ssh_pcap_context_connect(ssh_pcap_context ctx) ssh_set_error(session, SSH_REQUEST_DENIED, "Getting local IP address: %s", - strerror(errno)); + ssh_strerror(errno, err_msg, SSH_ERRNO_MSG_MAX)); return SSH_ERROR; } @@ -347,7 +348,7 @@ static int ssh_pcap_context_connect(ssh_pcap_context ctx) ssh_set_error(session, SSH_REQUEST_DENIED, "Getting remote IP address: %s", - strerror(errno)); + ssh_strerror(errno, err_msg, SSH_ERRNO_MSG_MAX)); return SSH_ERROR; }