From 42e3c6fff8aeaabc314d6b5581583bc01c6184f0 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 20 Sep 2024 10:56:11 +0200 Subject: [PATCH] [winpr,utils] fix winpr_strerror argument types errno is of type int, so use a signed INT32 as argument type to avoid warings with sign conversions --- winpr/include/winpr/debug.h | 2 +- winpr/libwinpr/utils/debug.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/winpr/include/winpr/debug.h b/winpr/include/winpr/debug.h index 43e6d2109..243028110 100644 --- a/winpr/include/winpr/debug.h +++ b/winpr/include/winpr/debug.h @@ -36,7 +36,7 @@ extern "C" WINPR_API void winpr_backtrace_free(void* buffer); WINPR_API char** winpr_backtrace_symbols(void* buffer, size_t* used); WINPR_API void winpr_backtrace_symbols_fd(void* buffer, int fd); - WINPR_API char* winpr_strerror(DWORD dw, char* dmsg, size_t size); + WINPR_API char* winpr_strerror(INT32 dw, char* dmsg, size_t size); #ifdef __cplusplus } diff --git a/winpr/libwinpr/utils/debug.c b/winpr/libwinpr/utils/debug.c index e2c2a6690..94818e5d8 100644 --- a/winpr/libwinpr/utils/debug.c +++ b/winpr/libwinpr/utils/debug.c @@ -230,14 +230,14 @@ fail: winpr_backtrace_free(stack); } -char* winpr_strerror(DWORD dw, char* dmsg, size_t size) +char* winpr_strerror(INT32 dw, char* dmsg, size_t size) { #ifdef __STDC_LIB_EXT1__ - strerror_s((int)dw, dmsg, size); + strerror_s(dw, dmsg, size); #elif defined(WINPR_HAVE_STRERROR_R) - strerror_r((int)dw, dmsg, size); + strerror_r(dw, dmsg, size); #else - (void)_snprintf(dmsg, size, "%s", strerror((int)dw)); + (void)_snprintf(dmsg, size, "%s", strerror(dw)); #endif return dmsg; }