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/Clist_modern/src/modern_cachefuncs.cpp | 4 ++-- plugins/Clist_modern/src/modern_clc.cpp | 2 +- plugins/Clist_modern/src/modern_rowtemplateopt.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index a45d9a02dd..1b6fa8b40a 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -465,8 +465,8 @@ int Cache_GetLineText( DBVARIANT dbv = {0}; // Try to get XStatusName if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { - if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) - mir_sntprintf(text, text_size, _T("%s"), dbv.pszVal); + if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0) + _tcsncpy_s(text, text_size, dbv.ptszVal, _TRUNCATE); CopySkipUnprintableChars(text, text, text_size-1); db_free(&dbv); } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index c234b7d400..873020a36c 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1365,7 +1365,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (sourceGrName) mir_sntprintf(newName, SIZEOF(newName), _T("%s\\%s"), sourceGrName, shortGroup); else - mir_sntprintf(newName, SIZEOF(newName), _T("%s"), shortGroup); + _tcsncpy_s(newName, shortGroup, _TRUNCATE); } mir_free(groupName); mir_free(sourceGrName); diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 97be36e25a..66581b5271 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -315,14 +315,14 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti) if (!cell->child) { if (cell->type == 0) - mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL?TranslateT("column"):TranslateT("line")); + mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line")); else - mir_sntprintf(buf, SIZEOF(buf), _T("%s"), TranslateTS(types[cell->type])); + _tcsncpy_s(buf, TranslateTS(types[cell->type]), _TRUNCATE); } else { if (cell->type == 0) - mir_sntprintf(buf, SIZEOF(buf), _T("%s"), cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines")); + _tcsncpy_s(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _TRUNCATE); else mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]),cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines")); } -- cgit v1.2.3