From 9cadeadaff74b37df1c2896e653a80b3ce4c86f6 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 23 May 2015 18:08:26 +0000 Subject: replace _tcsncpy to mir_tstrncpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewXstatusNotify/src/indsnd.cpp | 4 ++-- plugins/NewXstatusNotify/src/main.cpp | 12 ++++++------ plugins/NewXstatusNotify/src/options.cpp | 18 +++++++++--------- plugins/NewXstatusNotify/src/popup.cpp | 4 ++-- plugins/NewXstatusNotify/src/utils.cpp | 4 ++-- plugins/NewXstatusNotify/src/xstatus.cpp | 6 +++--- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'plugins/NewXstatusNotify') diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 011873b9e9..874f12db84 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -171,11 +171,11 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iItem = ListView_InsertItem(hList, &lvi); if (!db_get_ts(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) { - _tcsncpy(buff, dbv.ptszVal, SIZEOF(buff)-1); + mir_tstrncpy(buff, dbv.ptszVal, SIZEOF(buff)-1); db_free(&dbv); } else - _tcsncpy(buff, TranslateT(DEFAULT_SOUND), SIZEOF(buff)-1); + mir_tstrncpy(buff, TranslateT(DEFAULT_SOUND), SIZEOF(buff)-1); ListView_SetItemText(hList, lvi.iItem, 1, buff); } diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 90acfb1646..0bc711d4c3 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -289,18 +289,18 @@ void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, TCHAR *stz if (opt.UseAlternativeText) { switch (GetGender(hContact)) { case GENDER_MALE: - _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT); + mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT); break; case GENDER_FEMALE: - _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT); + mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT); break; case GENDER_UNSPECIFIED: - _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT); + mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT); break; } } else - _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT); + mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT); if (opt.ShowPreviousStatus) { TCHAR buff[MAX_STATUSTEXT]; @@ -328,7 +328,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) DBVARIANT dbv; TCHAR stzSoundFile[MAX_PATH] = { 0 }; if (!db_get_ts(hContact, MODULE, name, &dbv)) { - _tcsncpy(stzSoundFile, dbv.ptszVal, SIZEOF(stzSoundFile)-1); + mir_tstrncpy(stzSoundFile, dbv.ptszVal, SIZEOF(stzSoundFile)-1); db_free(&dbv); } @@ -686,7 +686,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (mir_tstrlen(smi.newstatusmsg) > opt.PSMsgLen)) { TCHAR buff[MAX_TEXT_LEN + 3]; copyText = mir_tstrdup(smi.newstatusmsg); - _tcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen); + mir_tstrncpy(buff, smi.newstatusmsg, opt.PSMsgLen); buff[opt.PSMsgLen] = 0; mir_tstrcat(buff, _T("...")); replaceStrT(smi.newstatusmsg, buff); diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 1952dd4e2f..eb29293ab5 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -381,13 +381,13 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM { TCHAR str[MAX_SECONDLINE] = { 0 }; for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) { - _tcsncpy(str, _T(""), SIZEOF(str)); + mir_tstrncpy(str, _T(""), SIZEOF(str)); if (opt.ShowStatus) { if (opt.UseAlternativeText == 1) - _tcsncpy(str, StatusList[Index(i)].lpzUStatusText, SIZEOF(str)); + mir_tstrncpy(str, StatusList[Index(i)].lpzUStatusText, SIZEOF(str)); else - _tcsncpy(str, StatusList[Index(i)].lpzStandardText, SIZEOF(str)); + mir_tstrncpy(str, StatusList[Index(i)].lpzStandardText, SIZEOF(str)); if (opt.ShowPreviousStatus) { TCHAR buff[MAX_STATUSTEXT]; @@ -405,9 +405,9 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, i), i, str); } - _tcsncpy(str, TranslateT("This is extra status"), SIZEOF(str)); + mir_tstrncpy(str, TranslateT("This is extra status"), SIZEOF(str)); ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_EXTRASTATUS, str); - _tcsncpy(str, TranslateT("This is status message"), SIZEOF(str)); + mir_tstrncpy(str, TranslateT("This is status message"), SIZEOF(str)); ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_STATUSMSG, str); return FALSE; @@ -731,17 +731,17 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA char protoname[MAX_PATH] = { 0 }; mir_snprintf(protoname, SIZEOF(protoname), "%s_TPopupSMsgChanged", protos[i]->szModuleName); if (db_get_ts(NULL, MODULE, protoname, &dbVar)) - _tcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, SIZEOF(prototemplate->ProtoTemplateMsg)); + mir_tstrncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, SIZEOF(prototemplate->ProtoTemplateMsg)); else { - _tcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplateMsg)); + mir_tstrncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplateMsg)); db_free(&dbVar); } mir_snprintf(protoname, SIZEOF(protoname), "%s_TPopupSMsgRemoved", protos[i]->szModuleName); if (db_get_ts(NULL, MODULE, protoname, &dbVar)) - _tcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, SIZEOF(prototemplate->ProtoTemplateRemoved)); + mir_tstrncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, SIZEOF(prototemplate->ProtoTemplateRemoved)); else { - _tcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplateRemoved)); + mir_tstrncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplateRemoved)); db_free(&dbVar); } diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 8410aea172..42758dd08f 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -36,7 +36,7 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR } _tcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE); - _tcsncpy(ppd.lptzText, stzText, SIZEOF(ppd.lptzText)); + mir_tstrncpy(ppd.lptzText, stzText, SIZEOF(ppd.lptzText)); switch (opt.Colors) { case POPUP_COLOR_OWN: @@ -87,7 +87,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) if (pstzLast) mir_sntprintf(stzText, SIZEOF(stzText), _T("%s\n%s"), pstzLast, tszStatus); else - _tcsncpy(stzText, tszStatus, SIZEOF(stzText)); + mir_tstrncpy(stzText, tszStatus, SIZEOF(stzText)); SendMessage(pdp->hWnd, WM_SETREDRAW, FALSE, 0); PUChangeTextT(pdp->hWnd, stzText); SendMessage(pdp->hWnd, WM_SETREDRAW, TRUE, 0); diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 7dd1e9dc58..b32069b5cf 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -45,12 +45,12 @@ int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSe { DBVARIANT dbv; if (!db_get_ts(hContact, szModule, szSetting, &dbv)) { - _tcsncpy(setting, dbv.ptszVal, size); + mir_tstrncpy(setting, dbv.ptszVal, size); db_free(&dbv); return 0; } - _tcsncpy(setting, defaultValue, size); + mir_tstrncpy(setting, defaultValue, size); return 1; } diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index e39af13d61..86aaac6084 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -192,7 +192,7 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc) if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (mir_tstrlen(xsc->stzText) > opt.PXMsgLen)) { TCHAR buff[MAX_TEXT_LEN + 3]; copyText = mir_tstrdup(xsc->stzText); - _tcsncpy(buff, xsc->stzText, opt.PXMsgLen); + mir_tstrncpy(buff, xsc->stzText, opt.PXMsgLen); buff[opt.PXMsgLen] = 0; mir_tstrcat(buff, _T("...")); replaceStrT(xsc->stzText, buff); @@ -436,7 +436,7 @@ TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buf if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0) GetDefaultXstatusName(statusID, szProto, buff, bufflen); else - _tcsncpy(buff, dbv.ptszVal, bufflen); + mir_tstrncpy(buff, dbv.ptszVal, bufflen); buff[bufflen - 1] = 0; db_free(&dbv); @@ -454,7 +454,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue); if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) { - _tcsncpy(buff, dbv.ptszVal, bufflen); + mir_tstrncpy(buff, dbv.ptszVal, bufflen); buff[bufflen - 1] = 0; db_free(&dbv); } -- cgit v1.2.3