[PATCH] set_sock_tos: clean up error message

Mike Frysinger vapier at gentoo.org
Thu Sep 29 19:18:23 AEST 2022


From: Mike Frysinger <vapier at chromium.org>

These include a trailing colon as if error() is going to display
another string after the message, but it doesn't.  No other call
to error() does this either.  So drop that.

One of the error messages also uses a %.100s format spec when
showing the strerror() output, but this doesn't actually do
anything.  So drop that.
---
 misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc.c b/misc.c
index f2135803737a..e51bd434de3a 100644
--- a/misc.c
+++ b/misc.c
@@ -278,7 +278,7 @@ set_sock_tos(int fd, int tos)
 		debug3_f("set socket %d IP_TOS 0x%02x", fd, tos);
 		if (setsockopt(fd, IPPROTO_IP, IP_TOS,
 		    &tos, sizeof(tos)) == -1) {
-			error("setsockopt socket %d IP_TOS %d: %s:",
+			error("setsockopt socket %d IP_TOS %d: %s",
 			    fd, tos, strerror(errno));
 		}
 # endif /* IP_TOS */
@@ -288,7 +288,7 @@ set_sock_tos(int fd, int tos)
 		debug3_f("set socket %d IPV6_TCLASS 0x%02x", fd, tos);
 		if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS,
 		    &tos, sizeof(tos)) == -1) {
-			error("setsockopt socket %d IPV6_TCLASS %d: %.100s:",
+			error("setsockopt socket %d IPV6_TCLASS %d: %s",
 			    fd, tos, strerror(errno));
 		}
 # endif /* IPV6_TCLASS */
-- 
2.37.3



More information about the openssh-unix-dev mailing list