From 635903271a8760dfbd4d461c72932990fda2cd71 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Jun 2024 17:32:07 +0300 Subject: =?UTF-8?q?fixes=20#4479=20(=D0=95=D1=81=D0=BB=D0=B8=20=D1=83=20?= =?UTF-8?q?=D1=8F=D0=B7=D1=8B=D0=BA=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=BA=D0=B5=D1=82=D0=B0=20=D0=BD=D0=B5=D1=82=20=D0=B4?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F,=20=D1=82=D0=BE=20=D0=BC=D1=8B=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BB=D0=B8=D0=B2=D0=B0=D0=B5=D0=BC=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=9D=D0=BE=D0=B2=D0=BE=D0=B5=20=D0=B2=D1=80?= =?UTF-8?q?=D0=B5=D0=BC=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_app/src/lpopts.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index 292d65f0e4..dc09995d09 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -118,20 +118,14 @@ void CLangpackDlg::LoadLangpacks() } // default langpack: English - LANGPACK_INFO pack; + LANGPACK_INFO pack = {}; pack.flags = LPF_DEFAULT; pack.Locale = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); mir_wstrcpy(pack.tszLanguage, L"English"); pack.szAuthors = "Miranda NG team"; - if (GetModuleFileName(nullptr, pack.tszFullPath, _countof(pack.tszFullPath))) { + if (GetModuleFileName(nullptr, pack.tszFullPath, _countof(pack.tszFullPath))) mir_wstrcpy(pack.tszFileName, L"default"); - HANDLE hFile = CreateFile(pack.tszFileName, 0, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr); - if (hFile != INVALID_HANDLE_VALUE) { - GetFileTime(hFile, nullptr, nullptr, &pack.ftFileDate); - CloseHandle(hFile); - } - } if (!isPackFound) pack.flags |= LPF_ENABLED; @@ -182,8 +176,9 @@ void CLangpackDlg::DisplayPackInfo(const LANGPACK_INFO *pack) SYSTEMTIME stFileDate; wchar_t szDate[128]; szDate[0] = 0; - if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate)) - GetDateFormat(Langpack_GetDefaultLocale(), DATE_SHORTDATE, &stFileDate, nullptr, szDate, _countof(szDate)); + if (pack->ftFileDate.dwHighDateTime && pack->ftFileDate.dwLowDateTime) + if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate)) + GetDateFormat(Langpack_GetDefaultLocale(), DATE_SHORTDATE, &stFileDate, nullptr, szDate, _countof(szDate)); m_date.SetText(szDate); m_authors.SetText(ptrW(mir_utf8decodeW(pack->szAuthors))); -- cgit v1.2.3