diff --git a/src/mdbx.c b/src/mdbx.c index d2a0e0f1..e6534c82 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -1133,8 +1133,8 @@ const char *__cold mdbx_strerror_r(int errnum, char *buf, size_t buflen) { const char *__cold mdbx_strerror(int errnum) { const char *msg = __mdbx_strerr(errnum); if (!msg) { - static char buffer[1024]; #ifdef _MSC_VER + static char buffer[1024]; size_t size = FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errnum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, @@ -1143,6 +1143,7 @@ const char *__cold mdbx_strerror(int errnum) { msg = buffer; #else if (errnum < 0) { + static char buffer[32]; int rc = snprintf(buffer, sizeof(buffer) - 1, "unknown error %d", errnum); assert(rc > 0); (void)rc;