From 85ef6630cdedb73d7767aa9c6af03304fbe01e47 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 8 Apr 2015 22:25:42 +0000 Subject: dead code removed git-svn-id: http://svn.miranda-ng.org/main/trunk@12688 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/timezones.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'src/modules/utils/timezones.cpp') diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index 46b8f8ce56..e2c271c140 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -254,16 +254,11 @@ static int timeapiPrintTimeStamp(HANDLE hTZ, mir_time ts, LPCTSTR szFormat, LPTS if (tz == NULL && (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY))) return 1; + if (tz == NULL) + tz = &myInfo.myTZ; + FILETIME ft; - - if (tz == NULL) tz = &myInfo.myTZ; - if (tz == NULL) { - FILETIME lft; - - UnixTimeToFileTime(ts, &lft); - FileTimeToLocalFileTime(&lft, &ft); - } - else if (tz == UTC_TIME_HANDLE) + if (tz == UTC_TIME_HANDLE) UnixTimeToFileTime(ts, &ft); else { if (tz->offset == INT_MIN) @@ -276,7 +271,6 @@ static int timeapiPrintTimeStamp(HANDLE hTZ, mir_time ts, LPCTSTR szFormat, LPTS FileTimeToSystemTime(&ft, &st); FormatTime(&st, szFormat, szDest, cbDest); - return 0; } @@ -289,16 +283,10 @@ static LPTIME_ZONE_INFORMATION timeapiGetTzi(HANDLE hTZ) static mir_time timeapiTimeStampToTimeZoneTimeStamp(HANDLE hTZ, mir_time ts) { MIM_TIMEZONE *tz = (MIM_TIMEZONE*)hTZ; + if (tz == NULL) + tz = &myInfo.myTZ; - if (tz == NULL) tz = &myInfo.myTZ; - if (tz == NULL) { - FILETIME ft, lft; - - UnixTimeToFileTime(ts, &ft); - FileTimeToLocalFileTime(&ft, &lft); - return FileTimeToUnixTime(&lft); - } - else if (tz == UTC_TIME_HANDLE) + if (tz == UTC_TIME_HANDLE) return ts; if (tz->offset == INT_MIN) @@ -481,18 +469,19 @@ extern "C" __declspec(dllexport) void RecalculateTime(void) if (pfnGetDynamicTimeZoneInformation && pfnGetDynamicTimeZoneInformation(&dtzi) != TIME_ZONE_ID_INVALID) { TCHAR *myTzKey = mir_u2t(dtzi.TimeZoneKeyName); - _tcscpy(myInfo.myTZ.tszName, myTzKey); + _tcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE); mir_free(myTzKey); found = true; } for (int i = 0; i < g_timezones.getCount(); i++) { MIM_TIMEZONE &tz = g_timezones[i]; - if (tz.offset != INT_MIN) tz.offset = INT_MIN; + if (tz.offset != INT_MIN) + tz.offset = INT_MIN; if (!found) { if (!wcscmp(tz.tzi.StandardName, myInfo.myTZ.tzi.StandardName) || !wcscmp(tz.tzi.DaylightName, myInfo.myTZ.tzi.DaylightName)) { - _tcscpy(myInfo.myTZ.tszName, tz.tszName); + _tcsncpy_s(myInfo.myTZ.tszName, tz.tszName, _TRUNCATE); found = true; } } -- cgit v1.2.3