From ab20dcde9f92042544cfc8077e6be9d22000cafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 16 Jul 2018 07:38:57 +0100 Subject: [PATCH] Use "secure version" of swcanf (#7774) This makes mingw builds usable again --- src/openrct2/platform/Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/platform/Windows.cpp b/src/openrct2/platform/Windows.cpp index e440843255..de7fec054e 100644 --- a/src/openrct2/platform/Windows.cpp +++ b/src/openrct2/platform/Windows.cpp @@ -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; }