Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 422fc2d

Browse files
committed
Merge branch 'PGPRO10_DEV' into PGPRO10
2 parents c9f3218 + 85450d1 commit 422fc2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/port/chklocale.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -959,12 +959,12 @@ check_icu_winlocale(const char *winlocale)
959959
}
960960
else
961961
{
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);
962+
size_t locale_len = strlen(winlocale);
963+
wchar_t *wlocale = (wchar_t*) ALLOC(
964+
(locale_len + 1) * sizeof(wchar_t));
965965
/* Locale names use only ASCII */
966-
size_t locale_wlen = char2wchar_ascii(wlocale, locale_wsize,
967-
winlocale, locale_size);
966+
size_t locale_wlen = char2wchar_ascii(wlocale, locale_len + 1,
967+
winlocale, locale_len);
968968
if (locale_wlen == -1)
969969
{
970970
/* there's an error */

0 commit comments

Comments
 (0)