summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/main.cpp
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-02 03:47:27 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-02 03:47:27 +0000
commit6e2b6b31bae6d69bff5271451e73eb08637b8118 (patch)
treeca636f1497e4cc6980736d56a7ff61e3a6f88079 /plugins/New_GPG/src/main.cpp
parentd83beb598f0944dcb944524b1d27525dc320cf18 (diff)
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
Diffstat (limited to 'plugins/New_GPG/src/main.cpp')
-rwxr-xr-xplugins/New_GPG/src/main.cpp21
1 files changed, 10 insertions, 11 deletions
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;