From 15b4d00e919d97015c208fff867862ef028995de Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 1 Dec 2014 23:27:22 +0000 Subject: static mir_tstrncpy replaced with direct _tcsncpy_s calls git-svn-id: http://svn.miranda-ng.org/main/trunk@11209 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/msgs.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins/TabSRMM/src/msgs.cpp') diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 4deb3f4b22..bea7f95208 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -584,13 +584,12 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, if (contactName && mir_tstrlen(contactName) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(contactName, newcontactname, SIZEOF(newcontactname)); - else { - mir_tstrncpy(newcontactname, contactName, SIZEOF(newcontactname)); - newcontactname[127] = 0; - } + else + _tcsncpy_s(newcontactname, contactName, _TRUNCATE); + Utils::DoubleAmpersands(newcontactname); } - else mir_tstrncpy(newcontactname, _T("_U_"), SIZEOF(newcontactname)); + else _tcsncpy_s(newcontactname, _T("_U_"), _TRUNCATE); WORD wStatus = (szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE)); TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); -- cgit v1.2.3