msvcrt: Bump MSVCRT_MB_LEN_MAX to 5 and use it in MSVCRT__wctomb_l for default buffer lengthSet MB_LEN_MAX to 5 to match MSVCRT_MB_LEN_MAX.
This commit is contained in:
parent
f0fc2ba27d
commit
8bf1732962
|
@ -47,7 +47,7 @@
|
||||||
#define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
|
#define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
|
||||||
#define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
|
#define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
|
||||||
#define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff)
|
#define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff)
|
||||||
#define MSVCRT_MB_LEN_MAX 2
|
#define MSVCRT_MB_LEN_MAX 5
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
#define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX
|
#define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1474,7 +1474,7 @@ int CDECL MSVCRT__wctomb_l(char *dst, MSVCRT_wchar_t ch, MSVCRT__locale_t locale
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
MSVCRT__wctomb_s_l(&len, dst, dst ? 6 : 0, ch, locale);
|
MSVCRT__wctomb_s_l(&len, dst, dst ? MSVCRT_MB_LEN_MAX : 0, ch, locale);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <crtdefs.h>
|
#include <crtdefs.h>
|
||||||
|
|
||||||
#define CHAR_BIT 8
|
#define CHAR_BIT 8
|
||||||
#define MB_LEN_MAX 2
|
#define MB_LEN_MAX 5
|
||||||
|
|
||||||
#define SCHAR_MIN (-0x80)
|
#define SCHAR_MIN (-0x80)
|
||||||
#define SCHAR_MAX 0x7f
|
#define SCHAR_MAX 0x7f
|
||||||
|
|
Loading…
Reference in New Issue