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 --- src/core/stdchat/src/main.cpp | 12 ++++++------ src/core/stdclist/src/clcfonts.cpp | 14 +++++++------- src/core/stdfile/src/fileexistsdlg.cpp | 2 +- src/core/stdfile/src/filerecvdlg.cpp | 4 ++-- src/core/stdmsg/src/msgoptions.cpp | 2 +- src/core/stduihist/src/history.cpp | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/core') diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 28390d4b66..62ad5f08a7 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -287,30 +287,30 @@ static void RegisterFonts() { ColourIDT colourid = { sizeof(colourid) }; mir_strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup)); - _tcsncpy(colourid.group, LPGENT("Chat module"), SIZEOF(colourid.group)); + mir_tstrncpy(colourid.group, LPGENT("Chat module"), SIZEOF(colourid.group)); mir_strncpy(colourid.setting, "ColorLogBG", SIZEOF(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Group chat log background"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Group chat log background"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "ColorMessageBG", SIZEOF(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Message background"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Message background"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "ColorNicklistBG", SIZEOF(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Nick list background"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Nick list background"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "ColorNicklistLines", SIZEOF(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Nick list lines"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Nick list lines"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER); ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "ColorNicklistSelectedBG", SIZEOF(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Nick list background (selected)"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Nick list background (selected)"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); ColourRegisterT(&colourid); } diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index 07e823d998..35f1f78962 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -54,7 +54,7 @@ void RegisterCListFonts() FontIDT fontid = { sizeof(fontid) }; fontid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS; mir_strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup)); - _tcsncpy(fontid.group, LPGENT("Contact list"), SIZEOF(fontid.group)); + mir_tstrncpy(fontid.group, LPGENT("Contact list"), SIZEOF(fontid.group)); HDC hdc = GetDC(NULL); for (int i = 0; i < SIZEOF(clistFontDescr); i++) { @@ -70,7 +70,7 @@ void RegisterCListFonts() fontid.flags &= ~FIDF_CLASSMASK; fontid.flags |= clistFontDescr[i].iMask; - _tcsncpy(fontid.name, clistFontDescr[i].tszName, SIZEOF(fontid.name)); + mir_tstrncpy(fontid.name, clistFontDescr[i].tszName, SIZEOF(fontid.name)); char idstr[10]; mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i); @@ -87,25 +87,25 @@ void RegisterCListFonts() mir_strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); mir_strncpy(colourid.setting, "BkColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); - _tcsncpy(colourid.group, LPGENT("Contact list"), SIZEOF(colourid.group)); + mir_tstrncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.group, LPGENT("Contact list"), SIZEOF(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Selected text"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Selected text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Hottrack text"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Hottrack text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; ColourRegisterT(&colourid); mir_strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Quicksearch text"), SIZEOF(colourid.name)); + mir_tstrncpy(colourid.name, LPGENT("Quicksearch text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; ColourRegisterT(&colourid); diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index 81b1a220ba..124ca9e37d 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -287,7 +287,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = hwndDlg; ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; - _tcsncpy(filter, TranslateT("All files"),SIZEOF(filter)-1); + mir_tstrncpy(filter, TranslateT("All files"),SIZEOF(filter)-1); mir_tstrcat(filter, _T(" (*)")); pfilter = filter + mir_tstrlen(filter) + 1; mir_tstrcpy(pfilter, _T("*")); diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index ccfaa427e2..5e50b02df8 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -117,7 +117,7 @@ static void patchDir(TCHAR *str, size_t strSize) TCHAR *result = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)str, (LPARAM)&dat); if (result) { - _tcsncpy(str, result, strSize); + mir_tstrncpy(str, result, strSize); mir_free(result); } @@ -158,7 +158,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO dat.hContact = hContact; TCHAR *result = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)tszTemp, (LPARAM)&dat); if (result) { - _tcsncpy(tszTemp, result, SIZEOF(tszTemp)); + mir_tstrncpy(tszTemp, result, SIZEOF(tszTemp)); mir_free(result); for (int i = 0; i < (SIZEOF(rvaVarsToReplace) - 1); i++) mir_free(rvaVarsToReplace[i].lptzValue); diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index f7e1ddeb2a..fa203b42b5 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -82,7 +82,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) DBVARIANT dbv; if (db_get_ts(NULL, SRMMMOD, str, &dbv)) - _tcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, SIZEOF(lf->lfFaceName)-1); + mir_tstrncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, SIZEOF(lf->lfFaceName)-1); else { mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName)); db_free(&dbv); diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 176a761ac4..fab500fa2d 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -40,7 +40,7 @@ static HGENMENU hContactMenu = 0; static void GetMessageDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf) { TCHAR *msg = DbGetEventTextT(dbei, CP_ACP); - _tcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf); + mir_tstrncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf); buf[ cbBuf-1 ] = 0; mir_free(msg); } @@ -125,7 +125,7 @@ static void GetObjectSummary(DBEVENTINFO *dbei, TCHAR* str, int cbStr) return; } - _tcsncpy(str, (const TCHAR*)pszSrc, cbStr); + mir_tstrncpy(str, (const TCHAR*)pszSrc, cbStr); str[cbStr-1] = 0; mir_free(pszTmp); } -- cgit v1.2.3