mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:04:12 +08:00
mdbx: refine Coverity warning fix.
Change-Id: I6bbb791f32a6b64712e88e0b2dd87052e353c730
This commit is contained in:
parent
31b5f64054
commit
bc77ab3cca
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user