From cff5a907c0c318d18c2e5fbcbc80d5e11c906492 Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Wed, 28 Aug 2024 12:36:57 +0200 Subject: [PATCH] ping: Use error() consistently strerror() is called in error(), no need to call it outside. Not a bug, just trying to be consistent (better cleanup could be a suggestion in https://github.com/iputils/iputils/issues/552). Fixes: eef1c38 ("ping: make command to use glibc error printing facility") Reviewed-by: Cyril Hrubis Reviewed-by: Benjamin Poirier Signed-off-by: Petr Vorel --- ping/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ping/ping.c b/ping/ping.c index 16ec5f1d..194684be 100644 --- a/ping/ping.c +++ b/ping/ping.c @@ -1463,7 +1463,7 @@ int ping4_receive_error_msg(struct ping_rts *rts, socket_st *sock) if (rts->opt_flood) write_stdout("E", 1); else if (e->ee_errno != EMSGSIZE) - error(0, 0, _("local error: %s"), strerror(e->ee_errno)); + error(0, e->ee_errno, _("local error")); else error(0, 0, _("local error: message too long, mtu=%u"), e->ee_info); rts->nerrors++;