Use "secure version" of swcanf (#7774)

This makes mingw builds usable again
This commit is contained in:
Michał Janiszewski 2018-07-16 07:38:57 +01:00 committed by GitHub
parent 97e50d56ab
commit ab20dcde9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ uint8_t platform_get_locale_date_format()
//
wchar_t first[sizeof(dateFormat)];
wchar_t second[sizeof(dateFormat)];
if (swscanf(dateFormat, L"%l[dyM]%*l[^dyM]%l[dyM]%*l[^dyM]%*l[dyM]", first, second) != 2) {
if (swscanf_s(dateFormat, L"%l[dyM]%*l[^dyM]%l[dyM]%*l[^dyM]%*l[dyM]", first, (uint32_t)Util::CountOf(first), second, (uint32_t)Util::CountOf(second)) != 2) {
return DATE_FORMAT_DAY_MONTH_YEAR;
}