From 07c8df374865e2e8d39eae23ad2ac884ba2d7b1e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 30 May 2025 13:56:00 +0200 Subject: [PATCH] rtp/net_udp: use strerror_s instead of _r compat already handled in compat/strings so not needed to replicate it --- src/rtp/net_udp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/rtp/net_udp.c b/src/rtp/net_udp.c index 1ddc40633..2a6624c47 100644 --- a/src/rtp/net_udp.c +++ b/src/rtp/net_udp.c @@ -60,6 +60,7 @@ #include "host.h" #include "memory.h" #include "compat/platform_pipe.h" +#include "compat/strings.h" // for strerror_s #include "compat/vsnprintf.h" #include "net_udp.h" #include "rtp.h" @@ -260,12 +261,8 @@ void socket_error(const char *msg, ...) va_start(ap, msg); vsnprintf(buffer, sizeof buffer, msg, ap); va_end(ap); -#if ! defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE >= 200112L && ! _GNU_SOURCE) - strerror_r(errno, strerror_buf, sizeof strerror_buf); // XSI version + strerror_s(strerror_buf, sizeof strerror_buf, errno); log_msg(LOG_LEVEL_ERROR, "%s: %s\n", buffer, strerror_buf); -#else // GNU strerror_r version - log_msg(LOG_LEVEL_ERROR, "%s: %s\n", buffer, strerror_r(errno, strerror_buf, sizeof strerror_buf)); -#endif #endif }