From 2a815f8820ca402626bd283dd5b75744ddeb9812 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 May 2015 18:55:59 +0000 Subject: mir_tstrncpy <> _tcsncpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13791 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SeenPlugin/src/options.cpp | 4 ++-- plugins/SeenPlugin/src/utils.cpp | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/SeenPlugin/src') diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 8d42ef154c..1c010e02c8 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -93,10 +93,10 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp ppd.lchIcon = LoadSkinnedProtoIcon(NULL, idBack); GetDlgItemText(hdlg, IDC_POPUPSTAMP, szstamp, SIZEOF(szstamp)); - mir_tstrncpy(ppd.lptzContactName, ParseString(szstamp, NULL, 0), MAX_CONTACTNAME); + _tcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL, 0), MAX_CONTACTNAME); GetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, szstamp, SIZEOF(szstamp)); - mir_tstrncpy(ppd.lptzText, ParseString(szstamp, NULL, 0), MAX_SECONDLINE); + _tcsncpy(ppd.lptzText, ParseString(szstamp, NULL, 0), MAX_SECONDLINE); PUAddPopupT(&ppd); SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index e8fa6ef4a3..ce2391d99e 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -266,7 +266,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) case 'G': if (!db_get_ts(hcontact, "CList", "Group", &dbv)) { - mir_tstrncpy(szdbsetting, dbv.ptszVal, SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, dbv.ptszVal, SIZEOF(szdbsetting)); db_free(&dbv); charPtr = szdbsetting; goto LBL_charPtr; @@ -287,7 +287,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) _ltot(ci.dVal, szdbsetting, 10); break; case CNFT_ASCIIZ: - mir_tstrncpy(szdbsetting, ci.pszVal, SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, ci.pszVal, SIZEOF(szdbsetting)); break; } } @@ -297,7 +297,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) case 's': if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) { - mir_tstrncpy(szdbsetting, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(isetting | 0x8000), GSMDF_TCHAR), SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(isetting | 0x8000), GSMDF_TCHAR), SIZEOF(szdbsetting)); if (!(isetting & 0x8000)) { mir_tstrncat(szdbsetting, _T("/"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); mir_tstrncat(szdbsetting, TranslateT("Idle"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); @@ -317,7 +317,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) case 'o': if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) { - mir_tstrncpy(szdbsetting, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)isetting, GSMDF_TCHAR), SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)isetting, GSMDF_TCHAR), SIZEOF(szdbsetting)); if (includeIdle && hcontact && db_get_b(hcontact, S_MOD, "OldIdle", 0)) { mir_tstrncat(szdbsetting, _T("/"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); mir_tstrncat(szdbsetting, TranslateT("Idle"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); @@ -333,7 +333,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) if (db_get_ts(hcontact, ci.szProto, *p == 'i' ? "Resource" : "System", &dbv)) goto LBL_noData; - mir_tstrncpy(szdbsetting, dbv.ptszVal, SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, dbv.ptszVal, SIZEOF(szdbsetting)); db_free(&dbv); charPtr = szdbsetting; } @@ -343,13 +343,13 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) goto LBL_noData; ia.S_un.S_addr = htonl(dwsetting); - mir_tstrncpy(szdbsetting, _A2T(inet_ntoa(ia)), SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), SIZEOF(szdbsetting)); charPtr = szdbsetting; } goto LBL_charPtr; case 'P': - mir_tstrncpy(szdbsetting, ci.szProto ? _A2T(ci.szProto) : (wantempty ? _T("") : _T("ProtoUnknown")), SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, ci.szProto ? _A2T(ci.szProto) : (wantempty ? _T("") : _T("ProtoUnknown")), SIZEOF(szdbsetting)); charPtr = szdbsetting; goto LBL_charPtr; @@ -359,7 +359,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) case 'C': // Get Client Info if (!db_get_ts(hcontact, ci.szProto, "MirVer", &dbv)) { - mir_tstrncpy(szdbsetting, dbv.ptszVal, SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, dbv.ptszVal, SIZEOF(szdbsetting)); db_free(&dbv); } else goto LBL_noData; @@ -374,7 +374,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) { PROTOACCOUNT *pa = ProtoGetAccount(ci.szProto); if (!pa) goto LBL_noData; - mir_tstrncpy(szdbsetting, pa->tszAccountName, SIZEOF(szdbsetting)); + _tcsncpy(szdbsetting, pa->tszAccountName, SIZEOF(szdbsetting)); charPtr = szdbsetting; goto LBL_charPtr; } @@ -496,16 +496,16 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) ppd.lchIcon = LoadSkinnedProtoIcon(lpzProto, newStatus); if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) { - mir_tstrncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact, 0), MAX_CONTACTNAME); + _tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact, 0), MAX_CONTACTNAME); db_free(&dbv); } - else mir_tstrncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact, 0), MAX_CONTACTNAME); + else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact, 0), MAX_CONTACTNAME); if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) { - mir_tstrncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact, 0), MAX_SECONDLINE); + _tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact, 0), MAX_SECONDLINE); db_free(&dbv); } - else mir_tstrncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact, 0), MAX_SECONDLINE); + else _tcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact, 0), MAX_SECONDLINE); ppd.PluginWindowProc = PopupDlgProc; PUAddPopupT(&ppd); } @@ -642,7 +642,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) if (p == NULL) { p = (logthread_info*)mir_calloc(sizeof(logthread_info)); p->hContact = hContact; - mir_strncpy(p->sProtoName, cws->szModule, MAXMODULELABELLENGTH); + strncpy(p->sProtoName, cws->szModule, MAXMODULELABELLENGTH); arContacts.insert(p); mir_forkthread(waitThread, p); } @@ -697,7 +697,7 @@ int ModeChange(WPARAM wparam, LPARAM lparam) db_set_dw(NULL, "UserOnline", ack->szModule, GetTickCount()); if (!Miranda_Terminated() && IsWatchedProtocol(ack->szModule)) { logthread_info *info = (logthread_info *)malloc(sizeof(logthread_info)); - mir_strncpy(info->sProtoName, courProtoName, MAXMODULELABELLENGTH); + strncpy(info->sProtoName, courProtoName, MAXMODULELABELLENGTH); info->hContact = 0; info->currStatus = 0; @@ -750,10 +750,10 @@ TCHAR* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, con { short int r = isDbZero(hContact, module_name, setting_name); if (r == -1) { - mir_tstrncpy(buff, TranslateT("Unknown"), bufflen); + _tcsncpy(buff, TranslateT("Unknown"), bufflen); } else { - mir_tstrncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen); + _tcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen); }; buff[bufflen - 1] = 0; return buff; @@ -763,7 +763,7 @@ TCHAR* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setti { if (isDbZero(hContact, module_name, setting_name) == 0) { //DB setting is NOT zero and exists buff[0] = L'/'; - mir_tstrncpy(&buff[1], TranslateT("Idle"), bufflen - 1); + _tcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1); } else buff[0] = 0; buff[bufflen - 1] = 0; -- cgit v1.2.3