From 6fcfba2c46a456677b5825a899469ba4e8905448 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 23 May 2015 17:49:58 +0000 Subject: replace strncpy to mir_strncpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/chat/options.cpp | 20 ++++++++++---------- plugins/TabSRMM/src/generic_msghandlers.cpp | 4 ++-- plugins/TabSRMM/src/sendlater.cpp | 6 +++--- plugins/TabSRMM/src/themes.cpp | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 5becbc5910..38df7808a1 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -494,13 +494,13 @@ void RegisterFontServiceFonts() fid.cbSize = sizeof(FontIDT); cid.cbSize = sizeof(ColourIDT); - strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup)); + mir_strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup)); for (int i = 0; i < SIZEOF(IM_fontOptionsList); i++) { fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS; LoadMsgDlgFont(FONTSECTION_IM, i, &lf, &fontOptionsList[i].colour, FONTMODULE); mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i); - strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix)); + mir_strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix)); fid.order = i; _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name)); fid.deffontsettings.colour = fontOptionsList[i].colour; @@ -563,7 +563,7 @@ void RegisterFontServiceFonts() for (int i = 0; i < IPFONTCOUNT; i++) { LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE); mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i + 100); - strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix)); + mir_strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix)); fid.order = i + 100; _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name)); fid.deffontsettings.colour = fontOptionsList[i].colour; @@ -582,12 +582,12 @@ void RegisterFontServiceFonts() } _tcsncpy(cid.group, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), SIZEOF(cid.group)); - strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup)); + mir_strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup)); for (int i = 0; i <= 7; i++) { mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i); _tcsncpy(cid.name, chatcolorsnames[i], SIZEOF(cid.name)); cid.order = i + 1; - strncpy(cid.setting, szTemp, SIZEOF(cid.setting)); + mir_strncpy(cid.setting, szTemp, SIZEOF(cid.setting)); switch (i) { case 5: cid.defcolour = GetSysColor(COLOR_HIGHLIGHT); @@ -613,14 +613,14 @@ void RegisterFontServiceFonts() ColourRegisterT(&cid); // static colors (info panel, tool bar background etc...) - strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup)); - strncpy(cid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup)); + mir_strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup)); + mir_strncpy(cid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup)); for (int i = 0; i < SIZEOF(_clrs); i++) { cid.order = _clrs[i].order; _tcsncpy(cid.group, _clrs[i].tszGroup, SIZEOF(fid.group)); _tcsncpy(cid.name, _clrs[i].tszName, SIZEOF(cid.name)); - strncpy(cid.setting, _clrs[i].szSetting, SIZEOF(cid.setting)); + mir_strncpy(cid.setting, _clrs[i].szSetting, SIZEOF(cid.setting)); if (_clrs[i].def & 0xff000000) cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff); else @@ -628,14 +628,14 @@ void RegisterFontServiceFonts() ColourRegisterT(&cid); } - strncpy(cid.dbSettingsGroup, SRMSGMOD_T, SIZEOF(fid.dbSettingsGroup)); + mir_strncpy(cid.dbSettingsGroup, SRMSGMOD_T, SIZEOF(fid.dbSettingsGroup)); // text and background colors for tabs for (int i = 0; i < SIZEOF(_tabclrs); i++) { cid.order = _tabclrs[i].order; _tcsncpy(cid.group, _tabclrs[i].tszGroup, SIZEOF(fid.group)); _tcsncpy(cid.name, _tabclrs[i].tszName, SIZEOF(cid.name)); - strncpy(cid.setting, _tabclrs[i].szSetting, SIZEOF(cid.setting)); + mir_strncpy(cid.setting, _tabclrs[i].szSetting, SIZEOF(cid.setting)); if (_tabclrs[i].def & 0xff000000) cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff); else diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 16cf2b8b38..be469c5842 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -813,7 +813,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) cf2.crTextColor = inputcharcolor; cf2.bCharSet = lf.lfCharSet; cf2.crBackColor = dat->inputbg; - strncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE); + mir_strncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE); cf2.dwEffects = 0; cf2.wWeight = (WORD)lf.lfWeight; cf2.bPitchAndFamily = lf.lfPitchAndFamily; @@ -830,7 +830,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC; cf2.crTextColor = inputcharcolor; cf2.bCharSet = lf.lfCharSet; - strncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE-1); + mir_strncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE-1); cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0) | (lf.lfUnderline ? CFE_UNDERLINE : 0) | (lf.lfStrikeOut ? CFE_STRIKEOUT : 0); cf2.wWeight = (WORD)lf.lfWeight; cf2.bPitchAndFamily = lf.lfPitchAndFamily; diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index bcc649242e..0cb77c3e32 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -325,14 +325,14 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) CSendLaterJob *job = new CSendLaterJob; - strncpy(job->szId, szSetting, 20); + mir_strncpy(job->szId, szSetting, 20); job->szId[19] = 0; job->hContact = hContact; job->created = atol(&szSetting[1]); size_t iLen = mir_strlen(szOrig_Utf); job->sendBuffer = reinterpret_cast(mir_alloc(iLen + 1)); - strncpy(job->sendBuffer, szOrig_Utf, iLen); + mir_strncpy(job->sendBuffer, szOrig_Utf, iLen); job->sendBuffer[iLen] = 0; // construct conventional send buffer @@ -345,7 +345,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) job->pBuf = (PBYTE)mir_calloc(required); - strncpy((char*)job->pBuf, szAnsi, iLen); + mir_strncpy((char*)job->pBuf, szAnsi, iLen); job->pBuf[iLen] = 0; if (szWchar) wcsncpy((wchar_t*)&job->pBuf[iLen + 1], szWchar, mir_wstrlen(szWchar)); diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index a0825801b6..46280b0072 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -817,7 +817,7 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) GetPrivateProfileString(m_szName, _T("Image"), _T("None"), buffer, 500, szFilename); if (mir_tstrcmp(buffer, _T("None")) || m_dwFlags & IMAGE_GLYPH) { szFinalName = new TCHAR[MAX_PATH]; - //strncpy(m_szName, &m_szName[1], sizeof(m_szName)); + //mir_strncpy(m_szName, &m_szName[1], sizeof(m_szName)); //m_szName[sizeof(m_szName) - 1] = 0; _tsplitpath(szFilename, szDrive, szPath, NULL, NULL); mir_sntprintf(szFinalName, MAX_PATH, _T("%s\\%s%s"), szDrive, szPath, buffer); -- cgit v1.2.3