mirror of
https://github.com/monero-project/monero.git
synced 2024-12-14 12:26:31 +02:00
Tweak mdb_strerror msg buffer
This commit is contained in:
parent
78ad970a2c
commit
3ca6e853f6
7
external/db_drivers/liblmdb/mdb.c
vendored
7
external/db_drivers/liblmdb/mdb.c
vendored
@ -1572,8 +1572,9 @@ mdb_strerror(int err)
|
|||||||
* This works as long as no function between the call to mdb_strerror
|
* This works as long as no function between the call to mdb_strerror
|
||||||
* and the actual use of the message uses more than 4K of stack.
|
* and the actual use of the message uses more than 4K of stack.
|
||||||
*/
|
*/
|
||||||
char pad[4096];
|
#define MSGSIZE 1024
|
||||||
char buf[1024], *ptr = buf;
|
#define PADSIZE 4096
|
||||||
|
char buf[MSGSIZE+PADSIZE], *ptr = buf;
|
||||||
#endif
|
#endif
|
||||||
int i;
|
int i;
|
||||||
if (!err)
|
if (!err)
|
||||||
@ -1605,7 +1606,7 @@ mdb_strerror(int err)
|
|||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
|
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL, err, 0, ptr, sizeof(buf), (va_list *)pad);
|
NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE);
|
||||||
return ptr;
|
return ptr;
|
||||||
#else
|
#else
|
||||||
return strerror(err);
|
return strerror(err);
|
||||||
|
Loading…
Reference in New Issue
Block a user