From 6e2b6b31bae6d69bff5271451e73eb08637b8118 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 2 Dec 2014 03:47:27 +0000 Subject: mir_sntprintf(..., _T("%s"), ...) -> _tcsncpy_s(..., ..., _TRUNCATE) fix some x64 ptr truncations git-svn-id: http://svn.miranda-ng.org/main/trunk@11211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/main.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'plugins/New_GPG') diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index ae5785ea2b..9d09305217 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -154,19 +154,18 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); TCHAR buf[5]; - mir_sntprintf(buf, 5, _T("%s"), expire_date); + _tcsncpy_s(buf, expire_date, _TRUNCATE); int year = _ttoi(buf); if(year < now.date().year()) expired = true; else if(year == now.date().year()) { - mir_sntprintf(buf, 3, _T("%s"), expire_date+5); + _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE); int month = _ttoi(buf); if(month < now.date().month()) expired = true; - else if(month == now.date().month()) - { - mir_sntprintf(buf, 3, _T("%s"), expire_date+8); + else if(month == now.date().month()) { + _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE); unsigned day = _ttoi(buf); if(day <= now.date().day_number()) expired = true; @@ -2125,19 +2124,19 @@ void InitCheck() { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); TCHAR buf[5]; - mir_sntprintf(buf, 5, _T("%s"), expire_date); + _tcsncpy_s(buf, expire_date, _TRUNCATE); int year = _ttoi(buf); if(year < now.date().year()) expired = true; else if(year == now.date().year()) { - mir_sntprintf(buf, 3, _T("%s"), expire_date+5); + _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE); int month = _ttoi(buf); if(month < now.date().month()) expired = true; else if(month == now.date().month()) { - mir_sntprintf(buf, 3, _T("%s"), expire_date+8); + _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE); unsigned day = _ttoi(buf); if(day <= now.date().day_number()) expired = true; @@ -2192,19 +2191,19 @@ void InitCheck() { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); TCHAR buf[5]; - mir_sntprintf(buf, 5, _T("%s"), expire_date); + _tcsncpy_s(buf, expire_date, _TRUNCATE); int year = _ttoi(buf); if(year < now.date().year()) expired = true; else if(year == now.date().year()) { - mir_sntprintf(buf, 3, _T("%s"), expire_date+5); + _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE); int month = _ttoi(buf); if(month < now.date().month()) expired = true; else if(month == now.date().month()) { - mir_sntprintf(buf, 3, _T("%s"), expire_date+8); + _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE); unsigned day = _ttoi(buf); if(day <= now.date().day_number()) expired = true; -- cgit v1.2.3