diff options
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/lpopts.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
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)));
|