diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 03:47:27 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 03:47:27 +0000 |
commit | 6e2b6b31bae6d69bff5271451e73eb08637b8118 (patch) | |
tree | ca636f1497e4cc6980736d56a7ff61e3a6f88079 /plugins/TabSRMM/src/chat | |
parent | d83beb598f0944dcb944524b1d27525dc320cf18 (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/TabSRMM/src/chat')
-rw-r--r-- | plugins/TabSRMM/src/chat/log.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/main.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/options.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 7129dc6361..cee377f6ca 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -629,7 +629,7 @@ static void AddEventToBuffer(char **buffer, int *bufferEnd, int *bufferAlloced, if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo);
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s"), szTemp2);
+ _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 9efe0eb1c4..994a7feabe 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -47,7 +47,7 @@ static void OnGetLogName(SESSION_INFO *si, LPCTSTR ptszParsedName) if (!PathIsAbsoluteT(ptszParsedName))
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M.getChatLogPath(), ptszParsedName);
else
- mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s"), ptszParsedName);
+ _tcsncpy_s(si->pszLogFileName, ptszParsedName, _TRUNCATE);
}
static void OnCreateSession(SESSION_INFO *si, MODULEINFO *mi)
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index dc89da275f..d4fb1228dc 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -831,7 +831,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case IDC_MUC_OPENLOGBASEDIR:
{
TCHAR tszTemp[MAX_PATH + 20];
- mir_sntprintf(tszTemp, MAX_PATH + 20, _T("%s"), g_Settings.pszLogDir);
+ _tcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE);
TCHAR *p = tszTemp;
while(*p && (*p == '\\' || *p == '.'))
@@ -841,10 +841,10 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (TCHAR *p1 = _tcschr(p, '\\'))
*p1 = 0;
- TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
- mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M.getChatLogPath(), p);
+ TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
+ mir_sntprintf(tszInitialDir, SIZEOF(tszInitialDir), _T("%s%s"), M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
- mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M.getChatLogPath());
+ _tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
mir_sntprintf(tszTemp, SIZEOF(tszTemp), _T("%s%c*.*%c%c"), TranslateT("All Files"), 0, 0, 0);
|