Merge pull request #10650 from akallabeth/winpr-errno

[winpr,utils] fix winpr_strerror argument types
This commit is contained in:
David Fort 2024-09-20 12:57:56 +02:00 committed by GitHub
commit 6660119422
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View File

@ -7,3 +7,8 @@ name = rdp_settings
[suppress_type]
type_kind = struct
has_data_members_inserted_at = end
# winpr_strerror did use unsigned instead of signed int as argument
[suppress_function]
change_kine = function-subtype-change
name = winpr_strerror

View File

@ -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
}

View File

@ -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;
}