From d8c4f35430ed57c6c9098663d0e60472207dcf3b Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 17 Dec 2021 00:08:53 +0800 Subject: [PATCH] Fix mingw GCC build issue --- err.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/err.cpp b/err.cpp index 80439e3..a23f3a8 100644 --- a/err.cpp +++ b/err.cpp @@ -13,7 +13,7 @@ bool err::get_errno_message(std::string &out, int errnum) { #if _WIN32 #if HAVE__WCSERROR_S wchar_t buf[512]; - if(!_wcserror_s(buf, errnum)) { + if(!_wcserror_s(buf, 512, errnum)) { std::wstring ws(buf); if(wchar_util::wstr_to_str(out, ws, CP_UTF8)) return true; } @@ -26,7 +26,7 @@ bool err::get_errno_message(std::string &out, int errnum) { #endif #if HAVE_STRERROR_S char nbuf[1024]; - if (!strerror_s(nbuf, errnum)) { + if (!strerror_s(nbuf, 1024, errnum)) { out = nbuf; return true; }