1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

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

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;
}