We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c9f3218 + 85450d1 commit 422fc2dCopy full SHA for 422fc2d
src/port/chklocale.c
@@ -959,12 +959,12 @@ check_icu_winlocale(const char *winlocale)
959
}
960
else
961
{
962
- size_t locale_size = strlen(winlocale) + 1;
963
- size_t locale_wsize = locale_size * sizeof(wchar_t);
964
- wchar_t *wlocale = (wchar_t*) ALLOC(locale_wsize);
+ size_t locale_len = strlen(winlocale);
+ wchar_t *wlocale = (wchar_t*) ALLOC(
+ (locale_len + 1) * sizeof(wchar_t));
965
/* Locale names use only ASCII */
966
- size_t locale_wlen = char2wchar_ascii(wlocale, locale_wsize,
967
- winlocale, locale_size);
+ size_t locale_wlen = char2wchar_ascii(wlocale, locale_len + 1,
+ winlocale, locale_len);
968
if (locale_wlen == -1)
969
970
/* there's an error */
0 commit comments