Victor Hermann Chiletto (@vitorhnn) commented about dlls/msvcrt/locale.c:
if (!strcmp(locale, data->cached_locale)) { if (codepage) *codepage = data->cached_cp;
if (sname)
wcsncpy(sname, data->cached_sname, sname_size);
if (sname_match)
*sname_match = data->cached_sname_match;
wcsncpy(sname, data->cached_sname, sname_size);
I think we should replace wcsncpy with lstrcpynW here and on lines 392 and 408.