From 504ea99cfa2b083965b427121c3f2a273542c7df Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Fri, 19 Sep 2025 22:23:28 -0500 Subject: CommonFuncs: Add StrerrorString version of LastStrerrorString that accepts an error number. --- Source/Core/Common/CommonFuncs.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common/CommonFuncs.cpp') diff --git a/Source/Core/Common/CommonFuncs.cpp b/Source/Core/Common/CommonFuncs.cpp index 91eed700ab..9d0b3c97b7 100644 --- a/Source/Core/Common/CommonFuncs.cpp +++ b/Source/Core/Common/CommonFuncs.cpp @@ -43,13 +43,18 @@ const char* StrErrorWrapper(int error, char* buffer, std::size_t length) #endif } +std::string StrerrorString(int error) +{ + char error_message[BUFFER_SIZE]; + + return StrErrorWrapper(error, error_message, BUFFER_SIZE); +} + // Wrapper function to get last strerror(errno) string. // This function might change the error code. std::string LastStrerrorString() { - char error_message[BUFFER_SIZE]; - - return StrErrorWrapper(errno, error_message, BUFFER_SIZE); + return StrerrorString(errno); } #ifdef _WIN32 -- cgit v1.2.3