diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-23 18:55:59 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-23 18:55:59 +0000 |
commit | 2a815f8820ca402626bd283dd5b75744ddeb9812 (patch) | |
tree | b230e7ac7d0330f5a1a0c8891d0a7dda9c5b47c6 | |
parent | 9a177a4e355c52775b580ad5687db2120f9282d5 (diff) |
mir_tstrncpy <> _tcsncpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13791 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
215 files changed, 691 insertions, 691 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 07e5538213..d14200ac06 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -129,7 +129,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) cacn.cbSize = sizeof(CONTACTAVATARCHANGEDNOTIFICATION);
cacn.hContact = hContact;
cacn.format = node->pa_format;
- mir_tstrncpy(cacn.filename, node->szFilename, MAX_PATH);
+ _tcsncpy(cacn.filename, node->szFilename, MAX_PATH);
cacn.filename[MAX_PATH - 1] = 0;
// Get hash
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index cb3d281f8c..fefbfd0596 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -149,7 +149,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) ace->bmHeight = 0;
ace->bmWidth = 0;
ace->lpDIBSection = NULL;
- mir_tstrncpy(ace->szFilename, tszFilename, MAX_PATH);
+ _tcsncpy(ace->szFilename, tszFilename, MAX_PATH);
ace->szFilename[MAX_PATH - 1] = 0;
if (ace->hbmPic == 0)
return -1;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 0fbf4f8b71..18659fec9c 100644 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -153,7 +153,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (len > 511) len = 511;
while(len > 0 && textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
len--;
- mir_tstrncpy(titlebuff, alarm.szTitle, len);
+ _tcsncpy(titlebuff, alarm.szTitle, len);
titlebuff[len] = 0;
mir_tstrcat(titlebuff, _T("..."));
GetTextExtentPoint32(dis->hDC,titlebuff,(int)mir_tstrlen(titlebuff),&textSize);
@@ -582,10 +582,10 @@ int CreateFrame() SendMessage(hwnd_plugin, WMU_INITIALIZE, 0, 0);
font_id.cbSize = sizeof(font_id);
- mir_strncpy(font_id.group, LPGEN("Frames"), sizeof(font_id.group));
- mir_strncpy(font_id.name, LPGEN("Alarm reminders"), sizeof(font_id.name));
- mir_strncpy(font_id.dbSettingsGroup, MODULE, sizeof(font_id.dbSettingsGroup));
- mir_strncpy(font_id.prefix, "Font", sizeof(font_id.prefix));
+ strncpy(font_id.group, LPGEN("Frames"), sizeof(font_id.group));
+ strncpy(font_id.name, LPGEN("Alarm reminders"), sizeof(font_id.name));
+ strncpy(font_id.dbSettingsGroup, MODULE, sizeof(font_id.dbSettingsGroup));
+ strncpy(font_id.prefix, "Font", sizeof(font_id.prefix));
font_id.order = 0;
FontRegister(&font_id);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 1140b09658..97e20e9dc8 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -384,7 +384,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara if (!db_get_s(NULL, MOD_NAME, "password", &dbVar)) {
g_fPassRequested = true;
- mir_strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
+ strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
db_free(&dbVar);
int res = DialogBox(g_hInstance, (MAKEINTRESOURCE(IDD_PASSDIALOGNEW)), GetForegroundWindow(), DlgStdInProc);
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index f201c24f26..f9f9a45d0a 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -267,8 +267,8 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -305,8 +305,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -495,8 +495,8 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) ppd.lchContact = hContact;
ppd.lchIcon = Skin_GetIcon("enabled_icon");
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 46037f326e..d936da7738 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -325,10 +325,10 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchContact = NULL;
ppd.lchIcon = hIcon;
- mir_tstrncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
TCHAR szPreviewText[250];
mir_sntprintf(szPreviewText, SIZEOF(szPreviewText), TranslateT("has returned after being absent since %d days"), rand() % 30);
- mir_tstrncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
- mir_tstrncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
ppd.lchIcon = Skin_GetIcon("enabled_icon");
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index 89398096aa..a7dc262382 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -354,8 +354,8 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- mir_tstrncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
- mir_tstrncpy(pdtData.lptzText, _T("Ghbdtn? rfr ltkf&"), MAX_SECONDLINE);
+ _tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ _tcsncpy(pdtData.lptzText, _T("Ghbdtn? rfr ltkf&"), MAX_SECONDLINE);
switch(poOptionsTemp.bColourType) {
case PPC_POPUP:
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index 04cc68afcf..644edb9bc9 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -301,7 +301,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
iRes = GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
- mir_tstrncpy(ptszInText, &ptszTemp[crSelection.cpMin], crSelection.cpMax - crSelection.cpMin);
+ _tcsncpy(ptszInText, &ptszTemp[crSelection.cpMin], crSelection.cpMax - crSelection.cpMin);
ptszInText[crSelection.cpMax - crSelection.cpMin] = 0;
}
else {
@@ -375,7 +375,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) if (WindowType == WTYPE_Edit) {
ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
- mir_tstrncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
+ _tcsncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
ptszTemp[crTemp.cpMax - crTemp.cpMin] = 0;
mir_tstrcpy(ptszInText, ptszTemp);
@@ -450,8 +450,8 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- mir_tstrncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
- mir_tstrncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
+ _tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ _tcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
switch (poOptions.bColourType) {
case PPC_POPUP:
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 30b3e2d92c..09fb832fe5 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -167,8 +167,8 @@ void ShowPopup(SHOWPOPUP_DATA *sd) ppd.lchIcon = LoadSkinnedProtoIcon(szProto, db_get_w(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE));
pdata->hIcon = NULL;
}
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)sd->hContact, GCDNF_TCHAR), lengthof(ppd.lptzContactName) - 1);
- mir_tstrncpy(ppd.lptzText, PopupText, lengthof(ppd.lptzText) - 1);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)sd->hContact, GCDNF_TCHAR), lengthof(ppd.lptzContactName) - 1);
+ _tcsncpy(ppd.lptzText, PopupText, lengthof(ppd.lptzText) - 1);
ppd.colorBack = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_BGCOLOUR));
ppd.colorText = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_TEXTCOLOUR));
ppd.PluginWindowProc = PopupWndProc;
diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.h b/plugins/ClientChangeNotify/src/CommonLibs/CString.h index 12e94ca80a..b2a1c4accf 100644 --- a/plugins/ClientChangeNotify/src/CommonLibs/CString.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.h @@ -37,7 +37,7 @@ __inline LPCSTR My_strstr(LPCSTR lpString1, LPCSTR lpString2) {return strstr(lpS __inline LPWSTR My_strstr(LPCWSTR lpString1, LPCWSTR lpString2) {return (LPWSTR)wcsstr(lpString1, lpString2);}
__inline LPSTR My_lstrcpy(LPSTR lpString1, LPCSTR lpString2) {return mir_strcpy(lpString1, lpString2);}
__inline LPWSTR My_lstrcpy(LPWSTR lpString1, LPCWSTR lpString2) {return mir_wstrcpy(lpString1, lpString2);}
-__inline LPSTR My_strncpy(LPSTR lpString1, LPCSTR lpString2, int Len) {return mir_strncpy(lpString1, lpString2, Len);}
+__inline LPSTR My_strncpy(LPSTR lpString1, LPCSTR lpString2, int Len) {return strncpy(lpString1, lpString2, Len);}
__inline LPWSTR My_strncpy(LPWSTR lpString1, LPCWSTR lpString2, int Len) {return wcsncpy(lpString1, lpString2, Len);}
__inline LPSTR My_strlwr(LPSTR lpString) {return _strlwr(lpString);}
__inline LPWSTR My_strlwr(LPWSTR lpString) {return _wcslwr(lpString);}
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 7bc81f8864..1d610cd65d 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -265,7 +265,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) size_t iLen = mir_tstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (iLen + 2) * sizeof(TCHAR));
- mir_tstrncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
+ _tcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
}
else {
int xStatus;
@@ -282,7 +282,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
TCHAR *szwXstatusName = TranslateTS(xStatusName);
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
- mir_tstrncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
+ _tcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 0b166c5937..c066d54371 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -2010,8 +2010,8 @@ static clistFontDescr[] = { void FS_RegisterFonts() { FontIDT fid = { sizeof(fid) }; - mir_tstrncpy(fid.group, LPGENT("Contact list"), SIZEOF(fid.group)); - mir_strncpy(fid.dbSettingsGroup, "CLC", 5); + _tcsncpy(fid.group, LPGENT("Contact list"), SIZEOF(fid.group)); + strncpy(fid.dbSettingsGroup, "CLC", 5); fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE; HDC hdc = GetDC(NULL); @@ -2028,11 +2028,11 @@ void FS_RegisterFonts() fid.flags &= ~FIDF_CLASSMASK; fid.flags |= clistFontDescr[i].iMask; - mir_tstrncpy(fid.name, clistFontDescr[i].tszName, SIZEOF(fid.name)); + _tcsncpy(fid.name, clistFontDescr[i].tszName, SIZEOF(fid.name)); char idstr[10]; mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i); - mir_strncpy(fid.prefix, idstr, SIZEOF(fid.prefix)); + strncpy(fid.prefix, idstr, SIZEOF(fid.prefix)); fid.order = i; FontRegisterT(&fid); } @@ -2042,35 +2042,35 @@ void FS_RegisterFonts() ColourIDT colourid = {0}; colourid.cbSize = sizeof(colourid); colourid.order = 0; - mir_strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); + strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); - mir_strncpy(colourid.setting, "BkColour", sizeof(colourid.setting)); - mir_tstrncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); - mir_tstrncpy(colourid.group, LPGENT("Contact list"), SIZEOF(colourid.group)); + strncpy(colourid.setting, "BkColour", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); + _tcsncpy(colourid.group, LPGENT("Contact list"), SIZEOF(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; ColourRegisterT(&colourid); - mir_strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); - mir_tstrncpy(colourid.name, LPGENT("Selected text"), SIZEOF(colourid.name)); + strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); + _tcsncpy(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)); - mir_tstrncpy(colourid.name, LPGENT("Hottrack text"), SIZEOF(colourid.name)); + strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); + _tcsncpy(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)); - mir_tstrncpy(colourid.name, LPGENT("Quicksearch text"), SIZEOF(colourid.name)); + strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Quicksearch text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; ColourRegisterT(&colourid); - mir_strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup)); - mir_strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting)); - mir_tstrncpy(colourid.name, LPGENT("Embedded frames border"), SIZEOF(colourid.name)); + strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup)); + strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Embedded frames border"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = RGB(40, 40, 40); ColourRegisterT(&colourid); diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 2b82577b11..bf285973c1 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -774,7 +774,7 @@ void IMG_ReadItem(const char *itemname, const char *szFileName) done_with_glyph:
- mir_strncpy(tmpItem.szName, &itemname[1], sizeof(tmpItem.szName));
+ strncpy(tmpItem.szName, &itemname[1], sizeof(tmpItem.szName));
tmpItem.szName[sizeof(tmpItem.szName) - 1] = 0;
_splitpath(szFileName, szDrive, szPath, NULL, NULL);
mir_snprintf(szFinalName, SIZEOF(szFinalName), "%s\\%s\\%s", szDrive, szPath, buffer);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 5126d10f0c..d18dddb6d1 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -447,7 +447,7 @@ void UpdateFilters() szBuf = (char *)malloc(iLen + 1);
SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szBuf);
- mir_strncpy(g_szModename, szBuf, sizeof(g_szModename));
+ strncpy(g_szModename, szBuf, sizeof(g_szModename));
g_szModename[sizeof(g_szModename) - 1] = 0;
mir_snprintf(szTemp, SIZEOF(szTemp), Translate("Current view mode: %s"), g_szModename);
SetDlgItemTextA(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
@@ -1051,7 +1051,7 @@ void ApplyViewMode(const char *name) mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name);
if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_strlen(dbv.pszVal) >= 2) {
- mir_strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter));
+ strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter));
cfg::dat.protoFilter[sizeof(cfg::dat.protoFilter) - 1] = 0;
cfg::dat.bFilterEffective |= CLVM_FILTER_PROTOS;
}
@@ -1060,7 +1060,7 @@ void ApplyViewMode(const char *name) mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name);
if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_tstrlen(dbv.ptszVal) >= 2) {
- mir_tstrncpy(cfg::dat.groupFilter, dbv.ptszVal, SIZEOF(cfg::dat.groupFilter));
+ _tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, SIZEOF(cfg::dat.groupFilter));
cfg::dat.groupFilter[SIZEOF(cfg::dat.groupFilter) - 1] = 0;
cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS;
}
@@ -1084,11 +1084,11 @@ void ApplyViewMode(const char *name) DWORD timerexpire;
mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name);
timerexpire = LOWORD(cfg::getDword(CLVM_MODULE, szSetting, 0));
- mir_strncpy(cfg::dat.old_viewmode, cfg::dat.current_viewmode, 256);
+ strncpy(cfg::dat.old_viewmode, cfg::dat.current_viewmode, 256);
cfg::dat.old_viewmode[255] = 0;
SetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
}
- mir_strncpy(cfg::dat.current_viewmode, name, 256);
+ strncpy(cfg::dat.current_viewmode, name, 256);
cfg::dat.current_viewmode[255] = 0;
if (cfg::dat.filterFlags & CLVM_USELASTMSG) {
diff --git a/plugins/CmdLine/MimCmd/src/commands.cpp b/plugins/CmdLine/MimCmd/src/commands.cpp index 5154c0012b..2cbdfe7430 100644 --- a/plugins/CmdLine/MimCmd/src/commands.cpp +++ b/plugins/CmdLine/MimCmd/src/commands.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. inline char *STRNCPY(char *output, const char *input, size_t size)
{
- char *res = mir_strncpy(output, input, size);
+ char *res = strncpy(output, input, size);
output[size - 1] = 0;
return res;
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index c954533e01..b7dce2a279 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -134,7 +134,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName res = 0;
size_t tmp = mir_strlen(dbv.pszVal);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_strncpy(szResult, dbv.pszVal, len);
+ strncpy(szResult, dbv.pszVal, len);
szResult[len] = '\0';
mir_free(dbv.pszVal);
}
@@ -144,7 +144,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName {
size_t tmp = mir_strlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_strncpy(szResult, szError, len);
+ strncpy(szResult, szError, len);
szResult[len] = '\0';
}
else{
@@ -440,7 +440,7 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, inline char *STRNCPY(char *output, const char *input, size_t size)
{
- char *res = mir_strncpy(output, input, size);
+ char *res = strncpy(output, input, size);
output[size - 1] = 0;
return res;
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp index 8e09246b6d..b35421de9e 100644 --- a/plugins/ConnectionNotify/src/debug.cpp +++ b/plugins/ConnectionNotify/src/debug.cpp @@ -28,7 +28,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) {
TCHAR* s = va_arg(argptr, TCHAR *);
mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, s);
- mir_tstrncpy(format, OutMsg, _countof(OutMsg));
+ _tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
break;
@@ -38,7 +38,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) {
char c = (char)va_arg(argptr, int);
mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, c);
- mir_tstrncpy(format, OutMsg, _countof(OutMsg));
+ _tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
break;
@@ -48,7 +48,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) {
int d = va_arg(argptr, int);
mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, d);
- mir_tstrncpy(format, OutMsg, _countof(OutMsg));
+ _tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
break;
diff --git a/plugins/ConnectionNotify/src/netstat.cpp b/plugins/ConnectionNotify/src/netstat.cpp index 14d21733b3..8f0eaa2155 100644 --- a/plugins/ConnectionNotify/src/netstat.cpp +++ b/plugins/ConnectionNotify/src/netstat.cpp @@ -42,14 +42,14 @@ struct CONNECTION *GetConnectionsTable() IpAddr.S_un.S_addr = (ULONG)pTcpTable->table[i].dwLocalAddr; //_snprintf(newConn->strIntIp,_countof(newConn->strIntIp),"%d.%d.%d.%d",IpAddr.S_un.S_un_b.s_b1,IpAddr.S_un.S_un_b.s_b2,IpAddr.S_un.S_un_b.s_b3,IpAddr.S_un.S_un_b.s_b4); TCHAR *strIntIp = mir_a2t(inet_ntoa(IpAddr)); - mir_tstrncpy(newConn->strIntIp, strIntIp, SIZEOF(newConn->strIntIp) - 1); + _tcsncpy(newConn->strIntIp, strIntIp, SIZEOF(newConn->strIntIp) - 1); mir_free(strIntIp); } if (pTcpTable->table[i].dwRemoteAddr) { IpAddr.S_un.S_addr = (u_long)pTcpTable->table[i].dwRemoteAddr; TCHAR *strExtIp = mir_a2t(inet_ntoa(IpAddr)); - mir_tstrncpy(newConn->strExtIp, strExtIp, SIZEOF(newConn->strExtIp) - 1); + _tcsncpy(newConn->strExtIp, strExtIp, SIZEOF(newConn->strExtIp) - 1); mir_free(strExtIp); } newConn->state = pTcpTable->table[i].dwState; diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 145478a702..8cd63e612a 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -86,7 +86,7 @@ BOOL CALLBACK LoadedModulesFind64(LPCSTR ModuleName, DWORD64 ModuleBase, ULONG M if ((DWORD)(data->Offset - ModuleBase) < ModuleSize) {
const size_t len = SIZEOF(data->pModule->ModuleName);
- mir_strncpy(data->pModule->ModuleName, ModuleName, len);
+ strncpy(data->pModule->ModuleName, ModuleName, len);
data->pModule->ModuleName[len - 1] = 0;
data->pModule->BaseOfImage = ModuleBase;
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 8554586a42..7e331f37ce 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -170,7 +170,7 @@ bool InternetDownloadFile(const char *szUrl, VerTrnsfr* szReq) szRedirUrl = (char*)mir_realloc(szRedirUrl,
rlen + mir_strlen(nlhrReply->headers[i].szValue) * 3 + 1);
- mir_strncpy(szRedirUrl, szUrl, rlen);
+ strncpy(szRedirUrl, szUrl, rlen);
mir_strcpy(szRedirUrl + rlen, nlhrReply->headers[i].szValue);
nlhr.szUrl = szRedirUrl;
diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp index b385b5465c..c7f1149dde 100644 --- a/plugins/DbChecker/src/main.cpp +++ b/plugins/DbChecker/src/main.cpp @@ -73,7 +73,7 @@ static INT_PTR CheckProfile(WPARAM wParam, LPARAM lParam) bLaunchMiranda = lParam != 0;
bAutoExit = lParam == 2;
bServiceMode = false;
- mir_tstrncpy(opts.filename, (TCHAR*)wParam, SIZEOF(opts.filename));
+ _tcsncpy(opts.filename, (TCHAR*)wParam, SIZEOF(opts.filename));
return DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc);
}
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index c58d9b8cae..1e580ba6a4 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -127,7 +127,7 @@ void copyModuleMenuItem(char* module, MCONTACT hContact) {
ModuleAndContact *mac = (ModuleAndContact *)mir_calloc(sizeof(ModuleAndContact));
mac->hContact = hContact;
- mir_strncpy(mac->module, module, 255);
+ strncpy(mac->module, module, 255);
CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
}
\ No newline at end of file diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 99877ae7ce..9c07ce46b7 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -314,19 +314,19 @@ void importSettings(MCONTACT hContact, char *importstring) p2 = strrchr(&importstring[i], '}*');
if (p1 && p2 && p1 + 3 < p2 && p2 - p1 < SIZEOF(szUID)) {
- mir_strncpy(szUID, p1 + 1, p2 - p1 - 2);
+ strncpy(szUID, p1 + 1, p2 - p1 - 2);
p1 = strrchr(&importstring[i], ')*<');
p2 = strrchr(&importstring[i], '>*{');
if (p1 && p2 && p1 + 3 < p2 && p2 - p1 < SIZEOF(uid)) {
- mir_strncpy(uid, p1 + 1, p2 - p1 - 3);
+ strncpy(uid, p1 + 1, p2 - p1 - 3);
p1 = strrchr(&importstring[i], ' *(');
p2 = strrchr(&importstring[i], ')*<');
if (p1 && p2 && p1 + 3 < p2 && p2 - p1 < SIZEOF(szProto)) {
- mir_strncpy(szProto, p1 + 1, p2 - p1 - 3);
+ strncpy(szProto, p1 + 1, p2 - p1 - 3);
char *protouid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)protouid != CALLSERVICE_NOTFOUND) {
@@ -558,7 +558,7 @@ void ImportSettingsFromFileMenuItem(MCONTACT hContact, char* FilePath) if (!mir_tstrcmp(szFileNames, "") == 0) {
if ((DWORD)mir_strlen(szFileNames) < offset) {
index += offset;
- mir_strncpy(szPath, szFileNames, offset);
+ strncpy(szPath, szFileNames, offset);
mir_strcat(szPath, "\\");
}
diff --git a/plugins/DbEditorPP/src/headers.h b/plugins/DbEditorPP/src/headers.h index 17f729c89b..425f14ec61 100644 --- a/plugins/DbEditorPP/src/headers.h +++ b/plugins/DbEditorPP/src/headers.h @@ -76,7 +76,7 @@ extern MCONTACT hRestore; #define WM_FINDITEM (WM_USER + 1) // onyl for the main window, wparam is ItemIfno* lparam is 0
#define mir_strlen(ptr) ((ptr == NULL) ? 0 : (int)mir_strlen(ptr))
-#define mir_strncpy(dst, src, len) mir_strncpy(dst, src, len)[len - 1] = 0;
+#define mir_strncpy(dst, src, len) strncpy(dst, src, len)[len - 1] = 0;
#define mir_strcmp(ptr1, ptr2) ((ptr1 && ptr2) ? mir_strcmp(ptr1, ptr2) : 1) // (ptr1||ptr2)
#define ListView_SetItemTextW(hwndLV, i, iSubItem_, pszText_) \
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 25c8a7e647..b8b97cec80 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -258,7 +258,7 @@ int DBGetContactSettingStringStatic(MCONTACT hContact, char *szModule, char *szS {
DBVARIANT dbv;
if (!db_get(hContact, szModule, szSetting, &dbv)) {
- mir_strncpy(value, dbv.pszVal, maxLength);
+ strncpy(value, dbv.pszVal, maxLength);
db_free(&dbv);
return 1;
}
@@ -313,7 +313,7 @@ int GetValue(MCONTACT hContact, const char *szModule, const char *szSetting, cha if (Value && length >= 10 && !GetSetting(hContact, szModule, szSetting, &dbv)) {
switch (dbv.type) {
case DBVT_ASCIIZ:
- mir_strncpy(Value, dbv.pszVal, length);
+ strncpy(Value, dbv.pszVal, length);
break;
case DBVT_DWORD:
_itoa(dbv.dVal, Value, 10);
@@ -330,7 +330,7 @@ int GetValue(MCONTACT hContact, const char *szModule, const char *szSetting, cha WCHAR *wc = (WCHAR *)_alloca(len * sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, wc, len);
WideCharToMultiByte(CP_ACP, 0, wc, -1, sz, len, NULL, NULL);
- mir_strncpy(Value, sz, length);
+ strncpy(Value, sz, length);
break;
}
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp index 6b4a6996e5..52a21e8a18 100644 --- a/plugins/Exchange/src/MirandaExchange.cpp +++ b/plugins/Exchange/src/MirandaExchange.cpp @@ -435,7 +435,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass TCHAR szPID[20];
_tstrtime(szPID);
- mir_tstrncpy(szPIDandName, m_szUsername, SIZEOF(szPIDandName)-1);
+ _tcsncpy(szPIDandName, m_szUsername, SIZEOF(szPIDandName)-1);
mir_tstrncat(szPIDandName, szPID, SIZEOF(szPIDandName) - mir_tstrlen(szPIDandName));
hr = CreateProfile(szPIDandName);
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index 0186ea9a07..e89a170732 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -95,15 +95,15 @@ char *BinToHex(int size, PBYTE data) void HexToBin(TCHAR *inData, ULONG &size, LPBYTE &outData)
{
TCHAR buffer[32] = {0};
- mir_tstrncpy(buffer, _T("0x"),_countof(_T("0x")));
- mir_tstrncpy(buffer + 2, inData, HEX_SIZE);
+ _tcsncpy(buffer, _T("0x"),_countof(_T("0x")));
+ _tcsncpy(buffer + 2, inData, HEX_SIZE);
_stscanf(buffer, _T("%x"), &size);
outData = (unsigned char*)new char[size*2];
TCHAR *tmp = inData + HEX_SIZE;
buffer[4] = '\0'; //mark the end of the string
for (UINT i = 0; i < size; i++) {
- mir_tstrncpy(buffer + 2, &tmp[i * 2], 2);
+ _tcsncpy(buffer + 2, &tmp[i * 2], 2);
_stscanf(buffer, _T("%x"), &outData[i]);
}
}
@@ -118,7 +118,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, res = 0;
int tmp = mir_tstrlen(dbv.ptszVal);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_tstrncpy(szResult, dbv.ptszVal, len);
+ _tcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
mir_free(dbv.ptszVal);
}
@@ -126,7 +126,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, res = 1;
int tmp = mir_tstrlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_tstrncpy(szResult, szError, len);
+ _tcsncpy(szResult, szError, len);
szResult[len] = '\0';
}
return res;
@@ -225,7 +225,7 @@ void _popupUtil(TCHAR* szMsg) {
POPUPDATAT ppd = {0};
ppd.lchIcon = hiMailIcon;
- mir_tstrncpy(ppd.lptzContactName, _T("Exchange notifier"), MAX_CONTACTNAME-1);
- mir_tstrncpy(ppd.lptzText, szMsg,MAX_SECONDLINE-1);
+ _tcsncpy(ppd.lptzContactName, _T("Exchange notifier"), MAX_CONTACTNAME-1);
+ _tcsncpy(ppd.lptzText, szMsg,MAX_SECONDLINE-1);
PUAddPopupT(&ppd); //show a popup to tell the user what we're doing.
}
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index aee1a962f8..7e5fa09bae 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -422,7 +422,7 @@ INT_PTR CALLBACK Manager::ManagerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, {
if (item->stzToolTip[0])
{
- mir_tstrncpy(tvInfoTip->pszText, item->stzToolTip, tvInfoTip->cchTextMax - 1);
+ _tcsncpy(tvInfoTip->pszText, item->stzToolTip, tvInfoTip->cchTextMax - 1);
tvInfoTip->pszText[tvInfoTip->cchTextMax - 1] = 0;
}
}
diff --git a/plugins/FloatingContacts/src/filedrop.cpp b/plugins/FloatingContacts/src/filedrop.cpp index febfd93610..f53edeba5b 100644 --- a/plugins/FloatingContacts/src/filedrop.cpp +++ b/plugins/FloatingContacts/src/filedrop.cpp @@ -221,7 +221,7 @@ static int CountFiles( char *szItem ) ( 0 != mir_strcmp( fd.cFileName, ".." )) )
{
char szDirName[MAX_PATH];
- mir_strncpy( szDirName, szItem, MAX_PATH - 1);
+ strncpy( szDirName, szItem, MAX_PATH - 1);
if ( NULL != strstr( szItem, "*.*" ))
{
@@ -263,7 +263,7 @@ static void SaveFiles( char *szItem, char **ppFiles, int *pnCount ) ( 0 != mir_strcmp( fd.cFileName, ".." )) )
{
char szDirName[MAX_PATH];
- mir_strncpy( szDirName, szItem, MAX_PATH - 1);
+ strncpy( szDirName, szItem, MAX_PATH - 1);
if ( NULL != strstr( szItem, "*.*" ))
{
@@ -284,7 +284,7 @@ static void SaveFiles( char *szItem, char **ppFiles, int *pnCount ) size_t nSize = sizeof(char) * ( mir_strlen( szItem ) + mir_strlen( fd.cFileName ) + sizeof( char ));
char *szFile = (char*) malloc( nSize ) ;
- mir_strncpy( szFile, szItem, nSize - 1);
+ strncpy( szFile, szItem, nSize - 1);
if ( NULL != strstr( szFile, "*.*" ))
{
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 3ca1983040..8a93846941 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -413,7 +413,7 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case WM_REFRESH_CONTACT:
if (pThumb) {
- mir_tstrncpy( pThumb->ptszName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pThumb->hContact, (LPARAM)GCDNF_TCHAR ), USERNAME_LEN - 1);
+ _tcsncpy( pThumb->ptszName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pThumb->hContact, (LPARAM)GCDNF_TCHAR ), USERNAME_LEN - 1);
pThumb->RefreshContactStatus((int)lParam);
pThumb->ResizeThumb();
}
@@ -628,7 +628,7 @@ void RegHotkey(MCONTACT hContact, HWND hwnd) DBVARIANT dbv;
if (db_get_s(hContact, MODULE, "Hotkey", &dbv)) return;
- mir_strncpy(szBuf, dbv.pszVal, MAX_PATH - 1);
+ strncpy(szBuf, dbv.pszVal, MAX_PATH - 1);
db_free( &dbv );
if (szBuf[0] != '\0') {
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index d7bd378618..e5ea984121 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -757,7 +757,7 @@ ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact) return NULL;
ThumbInfo *pThumb = new ThumbInfo;
- mir_tstrncpy( pThumb->ptszName, ptszName, USERNAME_LEN - 1);
+ _tcsncpy( pThumb->ptszName, ptszName, USERNAME_LEN - 1);
pThumb->hContact = hContact;
pThumb->hwnd = hwnd;
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index 008daa2254..4447fdece5 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -39,7 +39,7 @@ INT_PTR ExpandPath(TCHAR *szResult, TCHAR *format, int size) input = mir_tstrdup(format);
TCHAR *core_result = Utils_ReplaceVarsT(input);
- mir_tstrncpy(szResult, core_result, size);
+ _tcsncpy(szResult, core_result, size);
mir_free(core_result);
@@ -109,7 +109,7 @@ INT_PTR GetPathService(WPARAM wParam, LPARAM lParam) TCHAR buf[MAX_FOLDER_SIZE];
p->Expand(buf, SIZEOF(buf));
- mir_strncpy(data->szPath, _T2A(buf), data->nMaxPathSize);
+ strncpy(data->szPath, _T2A(buf), data->nMaxPathSize);
return 0;
}
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp index 90670505a1..4b3a310871 100644 --- a/plugins/Folders/src/utils.cpp +++ b/plugins/Folders/src/utils.cpp @@ -186,7 +186,7 @@ int GetStringFromDatabase(char *szSettingName, const wchar_t *szError, TCHAR *sz if (db_get_ws(NULL, ModuleName, szSettingName, &dbv) == 0) {
size_t tmp = mir_tstrlen(dbv.ptszVal);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_tstrncpy(szResult, dbv.ptszVal, len);
+ _tcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
db_free(&dbv);
return 0;
@@ -194,7 +194,7 @@ int GetStringFromDatabase(char *szSettingName, const wchar_t *szError, TCHAR *sz size_t tmp = mir_tstrlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_tstrncpy(szResult, szError, len);
+ _tcsncpy(szResult, szError, len);
szResult[len] = '\0';
return 1;
}
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 74775c5f2f..b2b67837ee 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -493,7 +493,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) { *(end - (start - (pstNewShare->pszSrvPath+1)) ) = '\0';
int realPathLen = szRealDirectoryEnd - pstNewShare->pszRealPath;
- mir_strncpy(szRealDirectoryEnd, pstNewShare->pszSrvPath+1,
+ strncpy(szRealDirectoryEnd, pstNewShare->pszSrvPath+1,
pstNewShare->dwMaxRealPath - realPathLen - 1);
pstNewShare->pszRealPath[pstNewShare->dwMaxRealPath] = '\0';
@@ -792,7 +792,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara szServPath[0] = '/';
char* fileName = strrchr(szDropedFile, '\\');
if (fileName)
- mir_strncpy(&szServPath[1], fileName+1, MAX_PATH-2);
+ strncpy(&szServPath[1], fileName+1, MAX_PATH-2);
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)&stNewShare)) {
MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
@@ -1429,8 +1429,8 @@ void ShowPopupWindow(const char * pszName, const char * pszText, COLORREF ColorB POPUPDATAT *pclData = new POPUPDATAT;
memset(pclData, 0, sizeof(POPUPDATAT));
pclData->lchIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
- mir_strncpy(pclData->lpzContactName, pszName, sizeof(pclData->lpzContactName) - 1); // -1 so that there aways will be a null termination !!
- mir_strncpy(pclData->lpzText, pszText, sizeof(pclData->lpzText) - 1);
+ strncpy(pclData->lpzContactName, pszName, sizeof(pclData->lpzContactName) - 1); // -1 so that there aways will be a null termination !!
+ strncpy(pclData->lpzText, pszText, sizeof(pclData->lpzText) - 1);
pclData->colorBack = ColorBack;
//ppd.colorText = colorText;
pclData->PluginWindowProc = PopupWindowProc;
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index 4c5604ea07..e1398215bc 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -396,8 +396,8 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { char* pszRealPath = pclCur->st.pszRealPath;
if (pclCur->bIsDirectory()) {
- mir_strncpy(szRealPath, pclCur->st.pszRealPath, MAX_PATH);
- mir_strncpy(szSrvPath, pclCur->st.pszSrvPath, MAX_PATH);
+ strncpy(szRealPath, pclCur->st.pszRealPath, MAX_PATH);
+ strncpy(szSrvPath, pclCur->st.pszSrvPath, MAX_PATH);
pszRealPath = szRealPath;
pszSrvPath = szSrvPath;
diff --git a/plugins/HTTPServer/src/IndexHTML.cpp b/plugins/HTTPServer/src/IndexHTML.cpp index 3a0dc74c16..a2ae11602f 100644 --- a/plugins/HTTPServer/src/IndexHTML.cpp +++ b/plugins/HTTPServer/src/IndexHTML.cpp @@ -62,7 +62,7 @@ bool LoadIndexHTMLTemplate() { char szDestBuf[10000];
char* pszDestBuf = szDestBuf;
- mir_strncpy(pszBuf, szPluginPath, SIZEOF(szBuf)-1);
+ strncpy(pszBuf, szPluginPath, SIZEOF(szBuf)-1);
mir_strncat(pszBuf, szIndexHTMLTemplateFile, SIZEOF(szBuf) - mir_strlen(szBuf));
HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -139,7 +139,7 @@ bool LoadIndexHTMLTemplate() { do {
if (*pszBuf == ',') {
*pszBuf = ':';
- mir_strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
+ strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
pszDestBuf += MAX_PARAM_LENGTH;
pszParameterBegin = pszBuf + 1;
@@ -152,7 +152,7 @@ bool LoadIndexHTMLTemplate() { break;
*pszBuf = ':';
- mir_strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
+ strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
pszDestBuf += MAX_PARAM_LENGTH;
*pcParamCount = iParamCount;
@@ -283,7 +283,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, // check if directory exists
char szMask[MAX_PATH];
- mir_strncpy(szMask, pszRealPath, MAX_PATH- 1);
+ strncpy(szMask, pszRealPath, MAX_PATH- 1);
mir_strncat(szMask, "*", SIZEOF(szMask) - mir_strlen(szMask));
WIN32_FIND_DATAA fdFindFileData;
@@ -319,14 +319,14 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, bool bEvenOdd = 0;
bool bKnownFileType = false;
- mir_strncpy(szBuffer, pszSrvPath, SIZEOF(szBuffer)-1);
+ strncpy(szBuffer, pszSrvPath, SIZEOF(szBuffer)-1);
char* pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
*pszTemp = '\0';
pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
- mir_strncpy(szName, pszTemp + 1, SIZEOF(szName)-1);
+ strncpy(szName, pszTemp + 1, SIZEOF(szName)-1);
if (szName[0] == '\0')
mir_strcpy(szName, "my Miranda Webserver");
@@ -470,7 +470,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, } else {
for (byte i = 0; i < iParamCount; i++) {
char szParam[MAX_PARAM_LENGTH+1];
- mir_strncpy(szParam, pszParam, MAX_PARAM_LENGTH);
+ strncpy(szParam, pszParam, MAX_PARAM_LENGTH);
szParam[MAX_PARAM_LENGTH] = '\0';
char* pszTmp = strchr(szParam, ':');
if (pszTmp)
diff --git a/plugins/HTTPServer/src/IndexXML.cpp b/plugins/HTTPServer/src/IndexXML.cpp index d24f76a03e..7de9c2cc8b 100644 --- a/plugins/HTTPServer/src/IndexXML.cpp +++ b/plugins/HTTPServer/src/IndexXML.cpp @@ -32,7 +32,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace, char* pszSign = strchr(pszSrc, pszReplace);
if (pszSign) {
- mir_strncpy(szBuffer, pszSrc, SIZEOF(szBuffer)-1);
+ strncpy(szBuffer, pszSrc, SIZEOF(szBuffer)-1);
do {
mir_strcpy(szBuffer + (pszSign - pszSrc), pszNew);
@@ -41,7 +41,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace, } while (pszSign = strchr(pszSrc, pszReplace));
- mir_strncpy(pszSrc, szBuffer, MaxLength);
+ strncpy(pszSrc, szBuffer, MaxLength);
pszSrc[MaxLength-1] = '\0';
}
@@ -64,7 +64,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace, bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
const char * pszSrvPath, DWORD dwRemoteIP) {
char szMask[MAX_PATH+1];
- mir_strncpy(szMask, pszRealPath, MAX_PATH);
+ strncpy(szMask, pszRealPath, MAX_PATH);
mir_strncat(szMask, "*", SIZEOF(szMask) - mir_strlen(szMask));
WIN32_FIND_DATAA fdFindFileData;
@@ -89,20 +89,20 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath, DWORD dwBytesWritten = 0;
// Generate Dirname
- mir_strncpy(szBuffer, pszSrvPath, BUFFER_SIZE);
+ strncpy(szBuffer, pszSrvPath, BUFFER_SIZE);
char* pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
*pszTemp = '\0';
pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
- mir_strncpy(szFileName, pszTemp + 1, MAX_PATH);
+ strncpy(szFileName, pszTemp + 1, MAX_PATH);
// Write Header
WriteFile(hFile, szXmlHeader1, sizeof(szXmlHeader1) - 1, &dwBytesWritten, NULL);
// check if a index.xsl exists in the same directory otherwise use the global
- mir_strncpy(szMask, pszRealPath, MAX_PATH);
+ strncpy(szMask, pszRealPath, MAX_PATH);
mir_strncat(szMask, "index.xsl", SIZEOF(szMask) - mir_strlen(szMask));
HANDLE hFileExists = CreateFile(szMask, GENERIC_READ,
@@ -110,10 +110,10 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileExists == INVALID_HANDLE_VALUE) {
- mir_strncpy(szBuffer, "/index.xsl", BUFFER_SIZE);
+ strncpy(szBuffer, "/index.xsl", BUFFER_SIZE);
} else {
CloseHandle(hFileExists);
- mir_strncpy(szBuffer, "index.xsl", BUFFER_SIZE);
+ strncpy(szBuffer, "index.xsl", BUFFER_SIZE);
}
WriteFile(hFile, szBuffer, (DWORD)mir_strlen(szBuffer), &dwBytesWritten, NULL);
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp index 4446898024..8d9e6aa737 100644 --- a/plugins/IEView/src/ScriverHTMLBuilder.cpp +++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp @@ -144,13 +144,13 @@ char *ScriverHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mod today = mktime(&tm_today);
if (dwFlags & SMF_LOG_USERELATIVEDATE && check >= today) {
- mir_strncpy(szResult, Translate("Today"), SIZEOF(szResult)-1);
+ strncpy(szResult, Translate("Today"), SIZEOF(szResult)-1);
if (mode == 0) {
mir_strcat(szResult, ",");
}
}
else if (dwFlags & SMF_LOG_USERELATIVEDATE && check > (today - 86400)) {
- mir_strncpy(szResult, Translate("Yesterday"), SIZEOF(szResult)-1);
+ strncpy(szResult, Translate("Yesterday"), SIZEOF(szResult)-1);
if (mode == 0) {
mir_strcat(szResult, ",");
}
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 3253e522d2..e63cfd2203 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -137,9 +137,9 @@ char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mo tm_today.tm_hour = tm_today.tm_min = tm_today.tm_sec = 0;
today = mktime(&tm_today);
if (dwFlags & Options::LOG_RELATIVE_DATE && check >= today)
- mir_tstrncpy(str, TranslateT("Today"), SIZEOF(str));
+ _tcsncpy(str, TranslateT("Today"), SIZEOF(str));
else if (dwFlags & Options::LOG_RELATIVE_DATE && check > (today - 86400))
- mir_tstrncpy(str, TranslateT("Yesterday"), SIZEOF(str));
+ _tcsncpy(str, TranslateT("Yesterday"), SIZEOF(str));
else {
dbtts.szFormat = (dwFlags & Options::LOG_LONG_DATE) ? _T("D") : _T("d");
CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, check, (LPARAM)& dbtts);
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 3c37db3363..6b1c50d224 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -217,7 +217,7 @@ void RegisterProtocol(char *proto, TCHAR *account) size_t id = proto_items.size();
proto_items.resize(id+1);
- mir_strncpy(proto_items[id].proto, proto, SIZEOF(proto_items[id].proto));
+ strncpy(proto_items[id].proto, proto, SIZEOF(proto_items[id].proto));
proto_items[id].proto[SIZEOF(proto_items[id].proto)-1] = 0;
mir_tstrncpy(proto_items[id].account, account, SIZEOF(proto_items[id].account));
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index a7a421f5af..c8683feba1 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -118,7 +118,7 @@ STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) retPassword = VARARG_GET (pArgs, char *);
fileName = VARARG_GET (pArgs, char *);
ownerName = VARARG_GET (pArgs, char *);
- mir_strncpy(retPassword, settingPassword, mir_strlen(settingPassword)); //set our password
+ strncpy(retPassword, settingPassword, mir_strlen(settingPassword)); //set our password
retPassword[mir_strlen(settingPassword)]='\0';
*retLength = (DWORD)mir_strlen(retPassword);//and his length
return ERR_BSAFE_EXTERNAL_PASSWORD;
@@ -1394,7 +1394,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM lParam) //gives name to protocol module
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, PLUGINNAME, wParam);
+ strncpy((char*)lParam, PLUGINNAME, wParam);
return 0;
}
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 79ee852e4c..91631104cf 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -215,8 +215,8 @@ void ShowPopup(char* szText, TCHAR* tszText, MCONTACT hContact) ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
ppd.lchContact = hContact;
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME - 1);
- mir_tstrncpy(ppd.lptzText, text, MAX_SECONDLINE - 1);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME - 1);
+ _tcsncpy(ppd.lptzText, text, MAX_SECONDLINE - 1);
ppd.iSeconds = -1;
PUAddPopupT(&ppd);
@@ -301,7 +301,7 @@ int StatusMsgExists(MCONTACT hContact) if (statusMsg[i].flag & 8)
mir_snprintf(par, SIZEOF(par), "%s/%s", module, statusMsg[i].name);
else
- mir_strncpy(par, statusMsg[i].name, SIZEOF(par)-1);
+ strncpy(par, statusMsg[i].name, SIZEOF(par)-1);
LPSTR msg = db_get_sa(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
if (msg) {
@@ -607,7 +607,7 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam) mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", szProto, szID);
}
else
- mir_strncpy(buffer, szID, SIZEOF(buffer)-1);
+ strncpy(buffer, szID, SIZEOF(buffer)-1);
CopyToClipboard((HWND)lparam, buffer, 0);
if (CTRL_IS_PRESSED && bPopupService)
@@ -632,7 +632,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) if (statusMsg[i].flag & 8)
mir_snprintf(par, SIZEOF(par), "%s/%s", module, statusMsg[i].name);
else
- mir_strncpy(par, statusMsg[i].name, SIZEOF(par) - 1);
+ strncpy(par, statusMsg[i].name, SIZEOF(par) - 1);
LPTSTR msg = db_get_tsa(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
if (msg) {
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index 55ca91add0..b3078c0c8d 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -90,7 +90,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) newmsg = (char*)mir_alloc(alloclen); memset(newmsg, 0, alloclen+datalen); - mir_strncpy(newmsg, options.prefix, prefixlen); + strncpy(newmsg, options.prefix, prefixlen); mir_strncat(newmsg, msg, alloclen - mir_strlen(newmsg)); // append additional data if (datalen) { @@ -129,7 +129,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) newmsg = (char*)mir_alloc(alloclen+datalen); memset(newmsg, 0, alloclen+datalen); - mir_strncpy(newmsg, prefix, prefixlen); + strncpy(newmsg, prefix, prefixlen); mir_strncat(newmsg, msg, alloclen + datalen - mir_strlen(newmsg)); wchar_t *p = (wchar_t*) newmsg + (msglen + prefixlen + 1); wcsncpy(p, prefixw, prefixlenw); @@ -157,7 +157,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) newmsg = (char*)mir_alloc(alloclen+datalen); memset(newmsg, 0, alloclen+datalen); - mir_strncpy(newmsg, prefix, prefixlen); + strncpy(newmsg, prefix, prefixlen); mir_strncat(newmsg, msg, msglen - mir_strlen(newmsg)); mir_free(prefix); // append additional data diff --git a/plugins/MirOTR/src/striphtml.cpp b/plugins/MirOTR/src/striphtml.cpp index 58f57c0c87..a7d84b69c4 100644 --- a/plugins/MirOTR/src/striphtml.cpp +++ b/plugins/MirOTR/src/striphtml.cpp @@ -9,7 +9,7 @@ void starttag_cb (void *cbdata, ekhtml_string_t *tag, ekhtml_attr_t *attrs) { case 'A':
for(ekhtml_attr_t *attr=attrs; attr; attr=attr->next) {
if (_strnicmp(attr->name.str, "href", attr->name.len)==0) {
- data->stack.push(mir_strncpy((char*)mir_calloc(attr->val.len+1), attr->val.str, attr->val.len));
+ data->stack.push(strncpy((char*)mir_calloc(attr->val.len+1), attr->val.str, attr->val.len));
break;
}
}
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 9d59edd5ab..5e9715e256 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -184,12 +184,12 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA ppd.lchIcon = NULL; if(line1 && line2) { - mir_tstrncpy( ppd.lptzContactName, line1, MAX_CONTACTNAME-1 ); - mir_tstrncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); + _tcsncpy( ppd.lptzContactName, line1, MAX_CONTACTNAME-1 ); + _tcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); } else if(line1) - mir_tstrncpy( ppd.lptzText, line1, MAX_SECONDLINE-1 ); + _tcsncpy( ppd.lptzText, line1, MAX_SECONDLINE-1 ); else if(line2) - mir_tstrncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); + _tcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 ); ppd.iSeconds = timeout; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp index a109624ea4..9d49c40aa8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp @@ -110,7 +110,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
- mir_tstrncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
+ _tcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
SetFont(lf);
}
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h index 12e94ca80a..b2a1c4accf 100644 --- a/plugins/NewAwaySysMod/src/CString.h +++ b/plugins/NewAwaySysMod/src/CString.h @@ -37,7 +37,7 @@ __inline LPCSTR My_strstr(LPCSTR lpString1, LPCSTR lpString2) {return strstr(lpS __inline LPWSTR My_strstr(LPCWSTR lpString1, LPCWSTR lpString2) {return (LPWSTR)wcsstr(lpString1, lpString2);}
__inline LPSTR My_lstrcpy(LPSTR lpString1, LPCSTR lpString2) {return mir_strcpy(lpString1, lpString2);}
__inline LPWSTR My_lstrcpy(LPWSTR lpString1, LPCWSTR lpString2) {return mir_wstrcpy(lpString1, lpString2);}
-__inline LPSTR My_strncpy(LPSTR lpString1, LPCSTR lpString2, int Len) {return mir_strncpy(lpString1, lpString2, Len);}
+__inline LPSTR My_strncpy(LPSTR lpString1, LPCSTR lpString2, int Len) {return strncpy(lpString1, lpString2, Len);}
__inline LPWSTR My_strncpy(LPWSTR lpString1, LPCWSTR lpString2, int Len) {return wcsncpy(lpString1, lpString2, Len);}
__inline LPSTR My_strlwr(LPSTR lpString) {return _strlwr(lpString);}
__inline LPWSTR My_strlwr(LPWSTR lpString) {return _wcslwr(lpString);}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 429611e13f..26abadd88b 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -490,12 +490,12 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U // if hContact is NULL, && hEvent is NULL then popup is only Test
if ((hContact == NULL) && (hEvent == NULL)) {
- mir_tstrncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
- mir_tstrncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
+ _tcsncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
+ _tcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
}
else { // get the needed event data
- mir_tstrncpy(pudw.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
- mir_tstrncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
+ _tcsncpy(pudw.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
}
PopupCount++;
@@ -573,7 +573,7 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) TCHAR timestamp[MAX_DATASIZE];
TCHAR formatTime[MAX_DATASIZE];
if (pdata->pluginOptions->bShowDate)
- mir_tstrncpy(formatTime, _T("%Y.%m.%d"), SIZEOF(formatTime));
+ _tcsncpy(formatTime, _T("%Y.%m.%d"), SIZEOF(formatTime));
else if (pdata->pluginOptions->bShowTime)
mir_tstrncat(formatTime, _T(" %H:%M"), SIZEOF(formatTime) - mir_tstrlen(formatTime));
time_t localTime = dbe.timestamp;
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 874f12db84..011873b9e9 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)) {
- mir_tstrncpy(buff, dbv.ptszVal, SIZEOF(buff)-1);
+ _tcsncpy(buff, dbv.ptszVal, SIZEOF(buff)-1);
db_free(&dbv);
}
else
- mir_tstrncpy(buff, TranslateT(DEFAULT_SOUND), SIZEOF(buff)-1);
+ _tcsncpy(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 0bc711d4c3..90acfb1646 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:
- mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
+ _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
break;
case GENDER_FEMALE:
- mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
+ _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
break;
case GENDER_UNSPECIFIED:
- mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
+ _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
break;
}
}
else
- mir_tstrncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
+ _tcsncpy(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)) {
- mir_tstrncpy(stzSoundFile, dbv.ptszVal, SIZEOF(stzSoundFile)-1);
+ _tcsncpy(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);
- mir_tstrncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
+ _tcsncpy(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 eb29293ab5..1952dd4e2f 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++) {
- mir_tstrncpy(str, _T(""), SIZEOF(str));
+ _tcsncpy(str, _T(""), SIZEOF(str));
if (opt.ShowStatus) {
if (opt.UseAlternativeText == 1)
- mir_tstrncpy(str, StatusList[Index(i)].lpzUStatusText, SIZEOF(str));
+ _tcsncpy(str, StatusList[Index(i)].lpzUStatusText, SIZEOF(str));
else
- mir_tstrncpy(str, StatusList[Index(i)].lpzStandardText, SIZEOF(str));
+ _tcsncpy(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);
}
- mir_tstrncpy(str, TranslateT("This is extra status"), SIZEOF(str));
+ _tcsncpy(str, TranslateT("This is extra status"), SIZEOF(str));
ShowChangePopup(NULL, LoadSkinnedProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_EXTRASTATUS, str);
- mir_tstrncpy(str, TranslateT("This is status message"), SIZEOF(str));
+ _tcsncpy(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))
- mir_tstrncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, SIZEOF(prototemplate->ProtoTemplateMsg));
+ _tcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, SIZEOF(prototemplate->ProtoTemplateMsg));
else {
- mir_tstrncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplateMsg));
+ _tcsncpy(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))
- mir_tstrncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, SIZEOF(prototemplate->ProtoTemplateRemoved));
+ _tcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, SIZEOF(prototemplate->ProtoTemplateRemoved));
else {
- mir_tstrncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplateRemoved));
+ _tcsncpy(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 42758dd08f..8410aea172 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);
- mir_tstrncpy(ppd.lptzText, stzText, SIZEOF(ppd.lptzText));
+ _tcsncpy(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
- mir_tstrncpy(stzText, tszStatus, SIZEOF(stzText));
+ _tcsncpy(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 b32069b5cf..7dd1e9dc58 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)) {
- mir_tstrncpy(setting, dbv.ptszVal, size);
+ _tcsncpy(setting, dbv.ptszVal, size);
db_free(&dbv);
return 0;
}
- mir_tstrncpy(setting, defaultValue, size);
+ _tcsncpy(setting, defaultValue, size);
return 1;
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 86aaac6084..e39af13d61 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);
- mir_tstrncpy(buff, xsc->stzText, opt.PXMsgLen);
+ _tcsncpy(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
- mir_tstrncpy(buff, dbv.ptszVal, bufflen);
+ _tcsncpy(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)) {
- mir_tstrncpy(buff, dbv.ptszVal, bufflen);
+ _tcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
}
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index a0d0d2b547..872fa7b141 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -2050,7 +2050,7 @@ void InitCheck() if(!home_dir_access || !temp_access || !gpg_valid) { TCHAR buf[4096]; - mir_tstrncpy(buf, gpg_valid?TranslateT("GPG binary is set and valid (this is good).\n"):TranslateT("GPG binary unset or invalid (plugin will not work).\n"), SIZEOF(buf)); + _tcsncpy(buf, gpg_valid?TranslateT("GPG binary is set and valid (this is good).\n"):TranslateT("GPG binary unset or invalid (plugin will not work).\n"), SIZEOF(buf)); mir_tstrncat(buf, home_dir_access?TranslateT("Home dir write access granted (this is good).\n"):TranslateT("Home dir has no write access (plugin most probably will not work).\n"), SIZEOF(buf) - mir_tstrlen(buf)); mir_tstrncat(buf, temp_access?TranslateT("Temp dir write access granted (this is good).\n"):TranslateT("Temp dir has no write access (plugin should work, but may have some problems, file transfers will not work)."), SIZEOF(buf) - mir_tstrlen(buf)); if(!gpg_valid) @@ -2246,8 +2246,8 @@ void InitCheck() ICQ_CUSTOMCAP cap; cap.cbSize = sizeof(ICQ_CUSTOMCAP); cap.hIcon = 0; - mir_strncpy(cap.name, "GPG Key AutoExchange", MAX_CAPNAME); - mir_strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); + strncpy(cap.name, "GPG Key AutoExchange", MAX_CAPNAME); + strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); for(int i = 0; i < count; i++) if( ProtoServiceExists(accounts[i]->szProtoName, PS_ICQ_ADDCAPABILITY)) @@ -2261,8 +2261,8 @@ void InitCheck() ICQ_CUSTOMCAP cap; cap.cbSize = sizeof(ICQ_CUSTOMCAP); cap.hIcon = 0; - mir_strncpy(cap.name, "GPG Encrypted FileTransfers", MAX_CAPNAME); - mir_strncpy(cap.caps, "GPGFileTransfer", sizeof(cap.caps)); + strncpy(cap.name, "GPG Encrypted FileTransfers", MAX_CAPNAME); + strncpy(cap.caps, "GPGFileTransfer", sizeof(cap.caps)); for(int i = 0; i < count; i++) if( ProtoServiceExists(accounts[i]->szProtoName, PS_ICQ_ADDCAPABILITY)) @@ -2302,7 +2302,7 @@ void ImportKey() DWORD exitcode; { ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); - mir_tstrncpy(tmp2, ptmp, MAX_PATH-1); + _tcsncpy(tmp2, ptmp, MAX_PATH-1); mir_free(ptmp); mir_tstrncat(tmp2, _T("\\"), SIZEOF(tmp2) - mir_tstrlen(tmp2)); mir_tstrncat(tmp2, _T("temporary_exported.asc"), SIZEOF(tmp2) - mir_tstrlen(tmp2)); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 5cd4560bf6..3c6f993507 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -538,7 +538,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) if(uin) { if( ProtoServiceExists(proto, PS_ICQ_CHECKCAPABILITY)) { ICQ_CUSTOMCAP cap = {0}; - mir_strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); + strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); if(ProtoCallService(proto, PS_ICQ_CHECKCAPABILITY, (WPARAM)ccs->hContact, (LPARAM)&cap)) { CallContactService(ccs->hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); return 0; @@ -835,7 +835,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if(bDebugLog) debuglog<<std::string(time_str()+": info(autoexchange, icq): checking for autoexchange icq capability, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR))); ICQ_CUSTOMCAP cap = {0}; - mir_strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); + strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); if( ProtoCallService(proto, PS_ICQ_CHECKCAPABILITY, hContact, (LPARAM)&cap)) { if(bDebugLog) debuglog<<std::string(time_str()+": info(autoexchange, icq): sending key requiest, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR))); @@ -917,7 +917,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if(!(dbei->flags & DBEF_SENT) && db_mc_isMeta((MCONTACT)w)) { char tmp[29]; - mir_strncpy(tmp, (char*)dbei->pBlob, 27); + strncpy(tmp, (char*)dbei->pBlob, 27); tmp[28] = '\0'; if(strstr(tmp, "-----BEGIN PGP MESSAGE-----")) { diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index d68030b79c..3973d1cd39 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -903,7 +903,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
MCONTACT hcnt = db_mc_tryMeta(hContact);
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
- mir_tstrncpy(tmp2, ptmp, MAX_PATH-1);
+ _tcsncpy(tmp2, ptmp, MAX_PATH-1);
mir_free(ptmp);
mir_tstrncat(tmp2, _T("\\"), SIZEOF(tmp2) - mir_tstrlen(tmp2));
mir_tstrncat(tmp2, _T("temporary_exported.asc"), SIZEOF(tmp2) - mir_tstrlen(tmp2));
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index a12d88d256..a4d4077ac8 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -61,14 +61,14 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx ofn.lStructSize=CDSIZEOF_STRUCT(OPENFILENAME,lpTemplateName); ofn.Flags=OFN_EXPLORER; ofn.lpstrTitle=TranslateW(WindowTittle); - mir_tstrncpy(filter,TranslateW(szExtDesc), SIZEOF(filter)-1); + _tcsncpy(filter,TranslateW(szExtDesc), SIZEOF(filter)-1); pfilter=filter+mir_tstrlen(filter)+1; mir_tstrcpy(pfilter, szExt); pfilter[mir_tstrlen(pfilter)+1] = '\0'; pfilter[mir_tstrlen(pfilter)+2] = '\0'; ofn.lpstrFilter=filter; tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, _T("")); - mir_tstrncpy(str, tmp, SIZEOF(str)-1); + _tcsncpy(str, tmp, SIZEOF(str)-1); mir_free(tmp); if(mir_tstrlen(str)< 2) str[0] = '\0'; @@ -544,7 +544,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) if( ProtoServiceExists(proto, PS_ICQ_CHECKCAPABILITY)) { supported_proto = true; ICQ_CUSTOMCAP cap = {0}; - mir_strncpy(cap.caps, "GPGFileTransfer",sizeof(cap.caps)); + strncpy(cap.caps, "GPGFileTransfer",sizeof(cap.caps)); if( ProtoCallService(proto, PS_ICQ_CHECKCAPABILITY, (WPARAM)ccs->hContact, (LPARAM)&cap)) cap_found = true; } @@ -1859,7 +1859,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) DWORD exitcode; { ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); - mir_tstrncpy(tmp2, ptmp, MAX_PATH-1); + _tcsncpy(tmp2, ptmp, MAX_PATH-1); mir_free(ptmp); mir_tstrncat(tmp2, _T("\\"), SIZEOF(tmp2) - mir_tstrlen(tmp2)); mir_tstrncat(tmp2, _T("temporary_exported.asc"), SIZEOF(tmp2) - mir_tstrlen(tmp2)); diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 40d6b050fd..3028cf5f2c 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -46,8 +46,8 @@ int findWordInString(const char* line, const char* string, int* lengthOfWord, in {
unsigned int i, j = 0;
char word[64] = "", OpenDivider[8], CloseDivider[8];
- mir_strncpy(OpenDivider, "(\"", sizeof(OpenDivider));
- mir_strncpy(CloseDivider, "\")", sizeof(CloseDivider));
+ strncpy(OpenDivider, "(\"", sizeof(OpenDivider));
+ strncpy(CloseDivider, "\")", sizeof(CloseDivider));
/* get the word we r looking for */
if (!strncmp(string, OpenDivider, mir_strlen(OpenDivider))) {
for (i = 2; strncmp(&string[i], CloseDivider, mir_strlen(CloseDivider)); i++) {
@@ -455,8 +455,8 @@ int stringReplacer(const char* oldString, char* newString, MCONTACT hContact) char *fileContents[MAXLINES] = { NULL }, tempString[MAX_STRING_LENGTH];
// setup the variable names
- mir_strncpy(newString, "", sizeof(newString));
- mir_strncpy(var_file, "file(", sizeof(var_file));
+ strncpy(newString, "", sizeof(newString));
+ strncpy(var_file, "file(", sizeof(var_file));
while ((positionInOldString < (int)mir_strlen(oldString)) && (oldString[positionInOldString] != '\0')) {
// load the file... must be first
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 5cf90eee22..20ac2bab12 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -230,9 +230,9 @@ void RegisterFontServiceFonts() FontIDT fontid = {0};
fontid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fontid.group, _T(SECTIONNAME), SIZEOF(fontid.group));
- mir_tstrncpy(fontid.backgroundGroup, _T(SECTIONNAME), SIZEOF(fontid.backgroundGroup) );
- mir_strncpy(fontid.dbSettingsGroup, MODULENAME, SIZEOF(fontid.dbSettingsGroup));
+ _tcsncpy(fontid.group, _T(SECTIONNAME), SIZEOF(fontid.group));
+ _tcsncpy(fontid.backgroundGroup, _T(SECTIONNAME), SIZEOF(fontid.backgroundGroup) );
+ strncpy(fontid.dbSettingsGroup, MODULENAME, SIZEOF(fontid.dbSettingsGroup));
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
HDC hDC = GetDC(NULL);
@@ -243,8 +243,8 @@ void RegisterFontServiceFonts() {
fontid.order = i;
mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i);
- mir_strncpy(fontid.prefix, szTemp, SIZEOF(fontid.prefix));
- mir_tstrncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
+ strncpy(fontid.prefix, szTemp, SIZEOF(fontid.prefix));
+ _tcsncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
fontid.deffontsettings.colour = fontOptionsList[i].defColour;
fontid.deffontsettings.size = (char)-MulDiv(fontOptionsList[i].defSize, nFontScale, 72);
@@ -252,8 +252,8 @@ void RegisterFontServiceFonts() fontid.deffontsettings.style = fontOptionsList[i].defStyle;
fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
- mir_tstrncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fontid.deffontsettings.szFace));
- mir_tstrncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, SIZEOF(fontid.backgroundName));
+ _tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fontid.deffontsettings.szFace));
+ _tcsncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, SIZEOF(fontid.backgroundName));
FontRegisterT(&fontid);
}
@@ -261,16 +261,16 @@ void RegisterFontServiceFonts() ColourIDT colorid = {0};
colorid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(colorid.group, _T(SECTIONNAME), SIZEOF(colorid.group));
- mir_strncpy(colorid.dbSettingsGroup, MODULENAME, SIZEOF(fontid.dbSettingsGroup));
+ _tcsncpy(colorid.group, _T(SECTIONNAME), SIZEOF(colorid.group));
+ strncpy(colorid.dbSettingsGroup, MODULENAME, SIZEOF(fontid.dbSettingsGroup));
colorid.flags = 0;
for (int i = 0; i < SIZEOF(colourOptionsList); i++)
{
colorid.order = i;
- mir_tstrncpy(colorid.name, colourOptionsList[i].szName, SIZEOF(colorid.name));
+ _tcsncpy(colorid.name, colourOptionsList[i].szName, SIZEOF(colorid.name));
colorid.defcolour = colourOptionsList[i].defColour;
- mir_strncpy(colorid.setting, colourOptionsList[i].szSettingName, SIZEOF(colorid.setting));
+ strncpy(colorid.setting, colourOptionsList[i].szSettingName, SIZEOF(colorid.setting));
ColourRegisterT(&colorid);
}
@@ -284,8 +284,8 @@ void LoadNRFont(int i, LOGFONT *lf, COLORREF *colour) FontIDT fontid = {0};
fontid.cbSize = sizeof(fontid);
- mir_tstrncpy(fontid.group, LPGENT(SECTIONNAME), SIZEOF(fontid.group));
- mir_tstrncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
+ _tcsncpy(fontid.group, LPGENT(SECTIONNAME), SIZEOF(fontid.group));
+ _tcsncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 8af81e76ec..49a8530db7 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -801,7 +801,7 @@ BOOL CheckRemindersAndStart(void) char* S2 = strchr(g_RemindSMS, '@');
char* S1 = (char*)malloc(S2 - g_RemindSMS);
- mir_strncpy(S1, g_RemindSMS, S2 - g_RemindSMS);
+ strncpy(S1, g_RemindSMS, S2 - g_RemindSMS);
S1[S2 - g_RemindSMS]= 0x0;
S2++;
Send(S1, S2, pReminder->Reminder ? pReminder->Reminder : "", NULL);
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 02ca99515e..07354e9c59 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -489,8 +489,8 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA int showMessage(const popup_t &msg)
{
POPUPDATAT ppd = { 0 };
- mir_tstrncpy(ppd.lptzText, strip(msg.message).c_str(), MAX_SECONDLINE);
- mir_tstrncpy(ppd.lptzContactName, msg.contact.c_str(), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, strip(msg.message).c_str(), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, msg.contact.c_str(), MAX_CONTACTNAME);
ppd.colorBack = msg.background;
ppd.colorText = msg.foreground;
ppd.lchIcon = getIcon(msg.icon);
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 7fe7c5dc9c..75dc07b063 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -82,19 +82,19 @@ void CNudgeElement::Load(void) mir_snprintf(SectionName,SIZEOF(SectionName),"%s-recText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- mir_tstrncpy(this->recText, dbv.ptszVal, TEXT_LEN);
+ _tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
if (_tcsclen(this->recText) < 1)
- mir_tstrncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else mir_tstrncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
mir_snprintf(SectionName, SIZEOF(SectionName), "%s-senText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- mir_tstrncpy(this->senText, dbv.ptszVal, TEXT_LEN);
+ _tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
if (_tcsclen(this->senText) < 1)
- mir_tstrncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else mir_tstrncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ else _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
}
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 06082185ae..d15119b7f9 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -553,7 +553,7 @@ void DeleteFileOrFolder(const char *name) WIN32_FIND_DATAA findData;
HANDLE hwnd = FindFirstFileA(name, &findData);
if (hwnd != INVALID_HANDLE_VALUE) {
- mir_strncpy(tmp, name, sizeof(tmp)-1);
+ strncpy(tmp, name, sizeof(tmp)-1);
strTmp = strrchr(tmp,'\\');
if(strTmp != NULL) {
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 9ff8429067..301ab1f909 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -37,7 +37,7 @@ void SetupInfobar(InfobarWindowData* idat) cf2.cbSize = sizeof(cf2);
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- mir_tstrncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -51,7 +51,7 @@ void SetupInfobar(InfobarWindowData* idat) cf2.cbSize = sizeof(cf2);
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- mir_tstrncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 27451b78b3..52840bd307 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1107,7 +1107,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC;
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- mir_tstrncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 25f4cb7bc1..9bf514bd3d 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -108,37 +108,37 @@ void RegisterFontServiceFonts() FontIDT fid = { sizeof(fid) };
_tcsncpy_s(fid.group, LPGENT("Messaging"), _TRUNCATE);
_tcsncpy_s(fid.backgroundGroup, LPGENT("Messaging"), _TRUNCATE);
- mir_strncpy(fid.dbSettingsGroup, SRMMMOD, SIZEOF(fid.dbSettingsGroup));
+ strncpy(fid.dbSettingsGroup, SRMMMOD, SIZEOF(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID | FIDF_DEFAULTVALID;
for (int i = 0; i < SIZEOF(fontOptionsList); i++) {
fid.order = i;
char szTemp[100];
mir_snprintf(szTemp, SIZEOF(szTemp), "SRMFont%d", i);
- mir_strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
- mir_tstrncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
+ strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
+ _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].defColour;
fid.deffontsettings.size = fontOptionsList[i].defSize;
fid.deffontsettings.style = fontOptionsList[i].defStyle;
fid.deffontsettings.charset = DEFAULT_CHARSET;
- mir_tstrncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fid.deffontsettings.szFace));
- mir_tstrncpy(fid.backgroundName, fontOptionsList[i].szBkgName, SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fid.deffontsettings.szFace));
+ _tcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, SIZEOF(fid.backgroundName));
FontRegisterT(&fid);
}
ColourIDT cid = { sizeof(cid) };
_tcsncpy_s(cid.group, LPGENT("Messaging"), _TRUNCATE);
- mir_strncpy(cid.dbSettingsGroup, SRMMMOD, SIZEOF(fid.dbSettingsGroup));
+ strncpy(cid.dbSettingsGroup, SRMMMOD, SIZEOF(fid.dbSettingsGroup));
cid.flags = 0;
for (int i = 0; i < SIZEOF(colourOptionsList); i++) {
cid.order = i;
- mir_tstrncpy(cid.name, colourOptionsList[i].szName, SIZEOF(cid.name));
+ _tcsncpy(cid.name, colourOptionsList[i].szName, SIZEOF(cid.name));
if (colourOptionsList[i].systemColor != -1)
cid.defcolour = GetSysColor(colourOptionsList[i].systemColor);
else
cid.defcolour = colourOptionsList[i].defColour;
- mir_strncpy(cid.setting, colourOptionsList[i].szSettingName, SIZEOF(cid.setting));
+ strncpy(cid.setting, colourOptionsList[i].szSettingName, SIZEOF(cid.setting));
ColourRegisterT(&cid);
}
}
@@ -192,7 +192,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) if (tszFace == NULL)
mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
- mir_tstrncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName));
+ _tcsncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName));
mir_snprintf(str, SIZEOF(str), "%s%dSet", "SRMFont", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 24148f7077..1d4e9b829f 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -199,8 +199,8 @@ TCHAR* limitText(TCHAR *text, int limit) size_t len = mir_tstrlen(text);
if (len > g_dat.limitNamesLength) {
TCHAR *ptszTemp = (TCHAR*)mir_alloc(sizeof(TCHAR) * (limit + 4));
- mir_tstrncpy(ptszTemp, text, limit + 1);
- mir_tstrncpy(ptszTemp + limit, _T("..."), 4);
+ _tcsncpy(ptszTemp, text, limit + 1);
+ _tcsncpy(ptszTemp + limit, _T("..."), 4);
return ptszTemp;
}
return text;
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index 6a5044482a..eca5257814 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -28,7 +28,7 @@ LPSTR myDBGetStringDecode(MCONTACT hContact, const char *szModule, const char *s if (!val) return NULL;
size_t len = mir_strlen(val) + 64;
char *buf = (LPSTR)mir_alloc(len);
- mir_strncpy(buf, val, len); mir_free(val);
+ strncpy(buf, val, len); mir_free(val);
return buf;
}
@@ -36,7 +36,7 @@ int myDBWriteStringEncode(MCONTACT hContact, const char *szModule, const char *s {
int len = (int)mir_strlen(val) + 64;
char *buf = (LPSTR)alloca(len);
- mir_strncpy(buf, val, len);
+ strncpy(buf, val, len);
int ret = db_set_s(hContact, szModule, szSetting, buf);
return ret;
}
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 29db82daed..28557fd1af 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -30,7 +30,7 @@ void loadSupportedProtocols() SupPro *p = (SupPro*)mir_calloc(sizeof(SupPro));
p->name = mir_strdup(protos[i]->szModuleName);
if (szNames && p->name) {
- char tmp[128]; mir_strncpy(tmp, p->name, sizeof(tmp) - 1); mir_strncat(tmp, ":", SIZEOF(tmp) - mir_strlen(tmp));
+ char tmp[128]; strncpy(tmp, p->name, sizeof(tmp) - 1); mir_strncat(tmp, ":", SIZEOF(tmp) - mir_strlen(tmp));
LPSTR szName = strstr(szNames, tmp);
if (szName) {
szName = strchr(szName, ':');
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index a3b37f6819..6d3362a52a 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -130,11 +130,11 @@ static int onModulesLoaded(WPARAM, LPARAM) else {
LPSTR tmp = db_get_sa(0, MODULENAME, "pgpPubRing");
if (tmp) {
- mir_strncpy(PubRingPath, tmp, sizeof(PubRingPath));
+ strncpy(PubRingPath, tmp, sizeof(PubRingPath));
mir_free(tmp);
}
if (tmp = db_get_sa(0, MODULENAME, "pgpSecRing")) {
- mir_strncpy(SecRingPath, tmp, sizeof(SecRingPath));
+ strncpy(SecRingPath, tmp, sizeof(SecRingPath));
mir_free(tmp);
}
if (PubRingPath[0] && SecRingPath[0]) {
@@ -163,11 +163,11 @@ static int onModulesLoaded(WPARAM, LPARAM) LPSTR tmp = db_get_sa(0, MODULENAME, "gpgExec");
if (tmp) {
- mir_strncpy(gpgexec, tmp, sizeof(gpgexec)-1);
+ strncpy(gpgexec, tmp, sizeof(gpgexec)-1);
mir_free(tmp);
}
if (tmp = db_get_sa(0, MODULENAME, "gpgHome")) {
- mir_strncpy(gpghome, tmp, sizeof(gpghome)-1);
+ strncpy(gpghome, tmp, sizeof(gpghome)-1);
mir_free(tmp);
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 5f95f66817..157ac96f8d 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1400,14 +1400,14 @@ void setListViewIcon(HWND hLV, UINT iItem, pUinKey ptr) void setListViewMode(HWND hLV, UINT iItem, UINT iMode)
{
char tmp[256];
- mir_strncpy(tmp, Translate(sim231[iMode]), sizeof(tmp)-1);
+ strncpy(tmp, Translate(sim231[iMode]), sizeof(tmp)-1);
LV_SetItemTextA(hLV, iItem, 2, tmp);
}
void setListViewStatus(HWND hLV, UINT iItem, UINT iStatus)
{
char tmp[128];
- mir_strncpy(tmp, Translate(sim232[iStatus]), sizeof(tmp)-1);
+ strncpy(tmp, Translate(sim232[iStatus]), sizeof(tmp)-1);
LV_SetItemTextA(hLV, iItem, 3, tmp);
}
@@ -1421,7 +1421,7 @@ UINT getListViewPSK(HWND hLV, UINT iItem) void setListViewPSK(HWND hLV, UINT iItem, UINT iStatus)
{
char str[128];
- mir_strncpy(str, (iStatus) ? Translate(sim206) : "-", sizeof(str)-1);
+ strncpy(str, (iStatus) ? Translate(sim206) : "-", sizeof(str)-1);
LV_SetItemTextA(hLV, iItem, 4, str);
}
@@ -1435,7 +1435,7 @@ UINT getListViewPUB(HWND hLV, UINT iItem) void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus)
{
char str[128];
- mir_strncpy(str, (iStatus) ? Translate(sim233) : "-", sizeof(str)-1);
+ strncpy(str, (iStatus) ? Translate(sim233) : "-", sizeof(str)-1);
LV_SetItemTextA(hLV, iItem, 4, str);
LPSTR sha = NULL;
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index bdfe43dfcd..e254f7b81e 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -865,7 +865,7 @@ int __cdecl onProtoAck(WPARAM wParam, LPARAM lParam) LPSTR p = strrchr(file_out, '.');
LPSTR x = strrchr(file_out, '\\');
if (p > x) {
- mir_strncpy(buf, p, sizeof(buf)-1);
+ strncpy(buf, p, sizeof(buf)-1);
pos = p;
}
for (int i = 1; i < 10000; i++) {
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;
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 11b40bf93c..87afd484ab 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -137,7 +137,7 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) len = 20;
char *temp2 = (char*)_alloca(len - 1);
- mir_strncpy(temp2, szValue, len - 2);
+ strncpy(temp2, szValue, len - 2);
temp2[len - 2] = '\0';
char *temp = (char*)_alloca(len + 1);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 7ad7daf798..9162be6f97 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -69,13 +69,13 @@ void log2file(const char *fmt, ...) HANDLE hFile = CreateFileA("simplestatusmsg.log", GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
SetFilePointer(hFile, 0, 0, FILE_END);
- mir_strncpy(szText, "[\0", SIZEOF(szText));
+ strncpy(szText, "[\0", SIZEOF(szText));
WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL, NULL, szText, SIZEOF(szText));
WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
- mir_strncpy(szText, "] \0", SIZEOF(szText));
+ strncpy(szText, "] \0", SIZEOF(szText));
va_start(va, fmt);
mir_vsnprintf(szText + mir_strlen(szText), SIZEOF(szText) - mir_strlen(szText), fmt, va);
@@ -83,7 +83,7 @@ void log2file(const char *fmt, ...) WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
- mir_strncpy(szText, "\n\0", SIZEOF(szText));
+ strncpy(szText, "\n\0", SIZEOF(szText));
WriteFile(hFile, szText, (DWORD)mir_strlen(szText), &dwBytesWritten, NULL);
CloseHandle(hFile);
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 6b0179125e..fb3ecbb303 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -305,7 +305,7 @@ static void MsgWndDetect(HWND hwndDlg, MCONTACT hContact, msgData* datm) // Get the protocol for this contact to display correct smileys.
char *protonam = GetContactProto(DecodeMetaContact(dat.hContact));
if (protonam) {
- mir_strncpy(dat.ProtocolName, protonam, sizeof(dat.ProtocolName));
+ strncpy(dat.ProtocolName, protonam, sizeof(dat.ProtocolName));
dat.ProtocolName[sizeof(dat.ProtocolName)-1] = 0;
}
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 46138ce186..338b84d279 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -98,7 +98,7 @@ bool InternetDownloadFile(const char *szUrl, char* szDest, HANDLE &hHttpDwnl) szRedirUrl = (char*)mir_realloc(szRedirUrl, rlen + mir_strlen(nlhrReply->headers[i].szValue)*3 + 1);
- mir_strncpy(szRedirUrl, szUrl, rlen);
+ strncpy(szRedirUrl, szUrl, rlen);
mir_strcpy(szRedirUrl+rlen, nlhrReply->headers[i].szValue);
nlhr.szUrl = szRedirUrl;
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 375a5a3b8e..fd8d00c01a 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -7,9 +7,9 @@ TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
- mir_tstrncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- mir_tstrncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
return buf;
@@ -20,12 +20,12 @@ TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
- mir_tstrncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- mir_tstrncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
- mir_tstrncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
+ _tcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
mir_free(tmp);
}
db_free(&dbv);
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 8c1f901f5d..ba907461ab 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -908,7 +908,7 @@ int AddContactTextBox(MCONTACT hContact, HWND hwnd, char *name, BOOL srmm, HWND dlg->hContact = hContact;
dlg->hwnd = hwnd;
- mir_strncpy(dlg->name, name, sizeof(dlg->name));
+ strncpy(dlg->name, name, sizeof(dlg->name));
dlg->enabled = db_get_b(dlg->hContact, MODULE_NAME, dlg->name, 1);
dlg->srmm = srmm;
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 8ac155c9b7..668b2cceea 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -802,7 +802,7 @@ static void CheckContinueslyFunction(void *) while ((*end != ' ') && (*end != '\0')) end++; memset(host, '\0', sizeof(host)); - mir_strncpy(host, start, end - start); + strncpy(host, start, end - start); hostent = gethostbyname(host); if (hostent != NULL) { addr = (DWORD *)(*hostent->h_addr_list); @@ -980,8 +980,8 @@ static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon) { POPUPDATAT ppd = { 0 }; ppd.lchIcon = hIcon; - mir_tstrncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); - mir_tstrncpy(ppd.lptzText, msg, MAX_SECONDLINE); + _tcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); + _tcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); if (db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) { ppd.colorBack = GetSysColor(COLOR_BTNFACE); ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index 82024fecae..c533847b03 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -480,8 +480,8 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ppd.lchContact = NULL;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_STATUS_OFFLINE);
- mir_tstrncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE);
if (IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))
{
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index d4cef9446d..3a7421957f 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -155,7 +155,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) TCHAR* buf = (TCHAR*)lParam; if (count == 0) { - mir_tstrncpy(buf, TranslateT("default"), 128-1); + _tcsncpy(buf, TranslateT("default"), 128-1); return 0; } @@ -165,7 +165,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) if ( db_get_ts(NULL, MODULENAME, setting, &dbv)) return -1; - mir_tstrncpy(buf, dbv.ptszVal, 128-1); buf[127] = 0; + _tcsncpy(buf, dbv.ptszVal, 128-1); buf[127] = 0; db_free(&dbv); return 0; } diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index ee5cfaeb4f..5becbc5910 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -494,62 +494,62 @@ void RegisterFontServiceFonts() fid.cbSize = sizeof(FontIDT);
cid.cbSize = sizeof(ColourIDT);
- mir_strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
+ 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);
- mir_strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
+ strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
fid.order = i;
- mir_tstrncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
+ _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].colour;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
fid.deffontsettings.charset = lf.lfCharSet;
fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
- mir_tstrncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
- mir_tstrncpy(fid.backgroundGroup, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), SIZEOF(fid.backgroundGroup));
- mir_tstrncpy(fid.group, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), SIZEOF(fid.group));
+ _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
+ _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), SIZEOF(fid.backgroundGroup));
+ _tcsncpy(fid.group, LPGENT("Message Sessions")_T("/")LPGENT("Single Messaging"), SIZEOF(fid.group));
switch (i) {
case MSGFONTID_MYMSG:
case 1:
case MSGFONTID_MYNAME:
case MSGFONTID_MYTIME:
case 21:
- mir_tstrncpy(fid.backgroundName, LPGENT("Outgoing background"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundName, LPGENT("Outgoing background"), SIZEOF(fid.backgroundName));
break;
case 8:
case 9:
case 12:
case 13:
- mir_tstrncpy(fid.backgroundName, LPGENT("Outgoing background(old)"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundName, LPGENT("Outgoing background(old)"), SIZEOF(fid.backgroundName));
break;
case 10:
case 11:
case 14:
case 15:
- mir_tstrncpy(fid.backgroundName, LPGENT("Incoming background(old)"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundName, LPGENT("Incoming background(old)"), SIZEOF(fid.backgroundName));
break;
case MSGFONTID_MESSAGEAREA:
- mir_tstrncpy(fid.group, LPGENT("Message Sessions"), SIZEOF(fid.group));
- mir_tstrncpy(fid.backgroundGroup, LPGENT("Message Sessions"), SIZEOF(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, LPGENT("Input area background"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.group, LPGENT("Message Sessions"), SIZEOF(fid.group));
+ _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), SIZEOF(fid.backgroundGroup));
+ _tcsncpy(fid.backgroundName, LPGENT("Input area background"), SIZEOF(fid.backgroundName));
fid.flags |= FIDF_DISABLESTYLES;
fid.flags &= ~FIDF_ALLOWEFFECTS;
break;
case 17:
- mir_tstrncpy(fid.backgroundName, LPGENT("Status background"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundName, LPGENT("Status background"), SIZEOF(fid.backgroundName));
break;
case 18:
- mir_tstrncpy(fid.backgroundGroup, LPGENT("Message Sessions"), SIZEOF(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, LPGENT("Log background"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), SIZEOF(fid.backgroundGroup));
+ _tcsncpy(fid.backgroundName, LPGENT("Log background"), SIZEOF(fid.backgroundName));
break;
case 19:
- mir_tstrncpy(fid.backgroundName, _T(""), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundName, _T(""), SIZEOF(fid.backgroundName));
break;
default:
- mir_tstrncpy(fid.backgroundName, LPGENT("Incoming background"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.backgroundName, LPGENT("Incoming background"), SIZEOF(fid.backgroundName));
break;
}
FontRegisterT(&fid);
@@ -557,37 +557,37 @@ void RegisterFontServiceFonts() fontOptionsList = IP_fontOptionsList;
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
- mir_tstrncpy(fid.group, LPGENT("Message Sessions")_T("/")LPGENT("Info Panel"), SIZEOF(fid.group));
- mir_tstrncpy(fid.backgroundGroup, LPGENT("Message Sessions")_T("/")LPGENT("Info Panel"), SIZEOF(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, LPGENT("Fields background"), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.group, LPGENT("Message Sessions")_T("/")LPGENT("Info Panel"), SIZEOF(fid.group));
+ _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions")_T("/")LPGENT("Info Panel"), SIZEOF(fid.backgroundGroup));
+ _tcsncpy(fid.backgroundName, LPGENT("Fields background"), SIZEOF(fid.backgroundName));
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);
- mir_strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
+ strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
fid.order = i + 100;
- mir_tstrncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
+ _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].colour;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
fid.deffontsettings.charset = lf.lfCharSet;
fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
fid.deffontsettings.charset = lf.lfCharSet;
- mir_tstrncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
+ _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
if (i == IPFONTCOUNT - 1) {
- mir_tstrncpy(fid.backgroundGroup, _T(""), SIZEOF(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, _T(""), SIZEOF(fid.backgroundName));
- mir_tstrncpy(fid.group, LPGENT("Message Sessions"), SIZEOF(fid.group));
+ _tcsncpy(fid.backgroundGroup, _T(""), SIZEOF(fid.backgroundGroup));
+ _tcsncpy(fid.backgroundName, _T(""), SIZEOF(fid.backgroundName));
+ _tcsncpy(fid.group, LPGENT("Message Sessions"), SIZEOF(fid.group));
}
FontRegisterT(&fid);
}
- mir_tstrncpy(cid.group, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), SIZEOF(cid.group));
- mir_strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup));
+ _tcsncpy(cid.group, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), SIZEOF(cid.group));
+ strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup));
for (int i = 0; i <= 7; i++) {
mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
- mir_tstrncpy(cid.name, chatcolorsnames[i], SIZEOF(cid.name));
+ _tcsncpy(cid.name, chatcolorsnames[i], SIZEOF(cid.name));
cid.order = i + 1;
- mir_strncpy(cid.setting, szTemp, SIZEOF(cid.setting));
+ 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...)
- mir_strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
- mir_strncpy(cid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
+ strncpy(fid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
+ strncpy(cid.dbSettingsGroup, FONTMODULE, SIZEOF(fid.dbSettingsGroup));
for (int i = 0; i < SIZEOF(_clrs); i++) {
cid.order = _clrs[i].order;
- mir_tstrncpy(cid.group, _clrs[i].tszGroup, SIZEOF(fid.group));
- mir_tstrncpy(cid.name, _clrs[i].tszName, SIZEOF(cid.name));
- mir_strncpy(cid.setting, _clrs[i].szSetting, SIZEOF(cid.setting));
+ _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));
if (_clrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff);
else
@@ -628,14 +628,14 @@ void RegisterFontServiceFonts() ColourRegisterT(&cid);
}
- mir_strncpy(cid.dbSettingsGroup, SRMSGMOD_T, SIZEOF(fid.dbSettingsGroup));
+ 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;
- mir_tstrncpy(cid.group, _tabclrs[i].tszGroup, SIZEOF(fid.group));
- mir_tstrncpy(cid.name, _tabclrs[i].tszName, SIZEOF(cid.name));
- mir_strncpy(cid.setting, _tabclrs[i].szSetting, SIZEOF(cid.setting));
+ _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));
if (_tabclrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff);
else
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index f996e50832..46c67ba0a1 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -168,7 +168,7 @@ void ShowRoom(SESSION_INFO *si, WPARAM, BOOL) if (pContainer == NULL) {
GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
if (!g_Settings.bOpenInDefault && !mir_tstrcmp(szName, _T("default")))
- mir_tstrncpy(szName, _T("Chat Rooms"), CONTAINER_NAMELEN);
+ _tcsncpy(szName, _T("Chat Rooms"), CONTAINER_NAMELEN);
szName[CONTAINER_NAMELEN] = 0;
pContainer = FindContainerByName(szName);
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 1e3632a40d..61e9997c1c 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1788,7 +1788,7 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData));
if (pContainer == NULL)
return NULL;
- mir_tstrncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
+ _tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
if (M.GetByte("limittabs", 0) && !mir_tstrcmp(name, _T("default")))
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 3282ca59e3..94fe049ccc 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -979,7 +979,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR _tcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE);
}
else if (sid->tszTooltip)
- mir_tstrncpy(wBuf, sid->tszTooltip, SIZEOF(wBuf));
+ _tcsncpy(wBuf, sid->tszTooltip, SIZEOF(wBuf));
if (wBuf[0]) {
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 40bbe9448c..f7d9d81686 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -532,7 +532,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) TCHAR lpzText[MAX_SECONDLINE];
int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
- mir_tstrncpy(lpzText, szHeader, MAX_SECONDLINE);
+ _tcsncpy(lpzText, szHeader, MAX_SECONDLINE);
available -= (int)mir_tstrlen(szHeader);
}
else lpzText[0] = 0;
@@ -622,12 +622,12 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve _tcsncpy_s(pud.lptzText, szPreview, _TRUNCATE);
mir_free(szPreview);
}
- else mir_tstrncpy(pud.lptzText, _T(" "), MAX_SECONDLINE);
+ else _tcsncpy(pud.lptzText, _T(" "), MAX_SECONDLINE);
pdata->eventData = (EVENT_DATAT *)mir_alloc(NR_MERGED * sizeof(EVENT_DATAT));
pdata->eventData[0].hEvent = hEvent;
pdata->eventData[0].timestamp = dbe.timestamp;
- mir_tstrncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
+ _tcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
pdata->eventData[0].tszText[MAX_SECONDLINE - 1] = 0;
pdata->nrEventsAlloced = NR_MERGED;
pdata->nrMerged = 1;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 68640fb48c..16cf2b8b38 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; - mir_strncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE); + 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; - mir_strncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE-1); + 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; @@ -1780,7 +1780,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) if (dat->idle != dwOldIdle || lParam != 0) { if (item.mask & TCIF_TEXT) { item.pszText = newtitle; - mir_tstrncpy(dat->newtitle, newtitle, SIZEOF(dat->newtitle)); + _tcsncpy(dat->newtitle, newtitle, SIZEOF(dat->newtitle)); dat->newtitle[127] = 0; if (dat->pWnd) dat->pWnd->updateTitle(dat->cache->getNick()); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index e3363eb1ae..9c642a0db2 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -989,11 +989,11 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors TCHAR tmp[10];
if (p[3] != ' ' && p[3] != '\\') {
- mir_tstrncpy(tmp, p + 2, 3);
+ _tcsncpy(tmp, p + 2, 3);
tmp[3] = 0;
}
else {
- mir_tstrncpy(tmp, p + 2, 2);
+ _tcsncpy(tmp, p + 2, 2);
tmp[2] = 0;
}
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index d32949d03f..67f7fb0733 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -133,8 +133,8 @@ void TSAPI CacheLogFonts() }
mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], SIZEOF(rtfFontsGlobal[MSGDLGFONTCOUNT]), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
- mir_tstrncpy(szToday, TranslateT("Today"), 20);
- mir_tstrncpy(szYesterday, TranslateT("Yesterday"), 20);
+ _tcsncpy(szToday, TranslateT("Today"), 20);
+ _tcsncpy(szYesterday, TranslateT("Yesterday"), 20);
szToday[19] = szYesterday[19] = 0;
// cache/create the info panel fonts
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 070771b799..5e83a533bc 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -787,7 +787,7 @@ static int TSAPI SetupIconLibConfig() int j = 2, version = 0;
TCHAR szFilename[MAX_PATH];
- mir_tstrncpy(szFilename, _T("icons\\tabsrmm_icons.dll"), MAX_PATH);
+ _tcsncpy(szFilename, _T("icons\\tabsrmm_icons.dll"), MAX_PATH);
g_hIconDLL = LoadLibrary(szFilename);
if (g_hIconDLL == 0) {
CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE | MB_ICONERROR | MB_OK);
@@ -824,7 +824,7 @@ static int TSAPI SetupIconLibConfig() sid.iDefaultIndex = -IDI_CLOCK;
Skin_AddIcon(&sid);
- mir_tstrncpy(szFilename, _T("plugins\\tabsrmm.dll"), MAX_PATH);
+ _tcsncpy(szFilename, _T("plugins\\tabsrmm.dll"), MAX_PATH);
sid.pszName = "tabSRMM_overlay_disabled";
sid.pszDescription = LPGEN("Feature disabled (used as overlay)");
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 6b34af57fe..41b7951151 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -128,7 +128,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
- mir_tstrncpy(p->szName, szNewName, CONTAINER_NAMELEN);
+ _tcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
}
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 0cb77c3e32..bcc649242e 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;
- mir_strncpy(job->szId, szSetting, 20);
+ 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<char *>(mir_alloc(iLen + 1));
- mir_strncpy(job->sendBuffer, szOrig_Utf, iLen);
+ 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);
- mir_strncpy((char*)job->pBuf, szAnsi, iLen);
+ 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 46280b0072..a0825801b6 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];
- //mir_strncpy(m_szName, &m_szName[1], sizeof(m_szName));
+ //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);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index a4bb0e2243..f8762db894 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -342,7 +342,7 @@ TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat) DBVARIANT dbv = { 0 };
if (!db_get_ts(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
- mir_tstrncpy(szTemp, dbv.ptszVal, 500);
+ _tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
db_free(&dbv);
title.insert(tempmark + 2, szTemp);
@@ -363,7 +363,7 @@ TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat) DBVARIANT dbv = { 0 };
if (!db_get_ts(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
- mir_tstrncpy(szTemp, dbv.ptszVal, 500);
+ _tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
db_free(&dbv);
title.insert(tempmark + 2, szTemp);
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index 6fd7cbf805..a6ac7e8cd9 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -314,11 +314,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco char smileyProto[64];
if (protocol == NULL)
- mir_strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
+ strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else if (mir_strcmp(protocol, META_PROTO) == 0)
- mir_strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
+ strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else
- mir_strncpy(smileyProto, protocol, sizeof(smileyProto) - 1);
+ strncpy(smileyProto, protocol, sizeof(smileyProto) - 1);
// Parse it!
SMADD_BATCHPARSE2 sp = { 0 };
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 07c8ba99ef..85ca77b699 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -49,8 +49,8 @@ void CreateDefaultItems() for (int i = 0; defaultItemList[i].szName; i++) {
if (defaultItemList[i].szName[0] == '-') {
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- mir_tstrncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
di_node->di.bLineAbove = true;
di_node->di.bIsVisible = true;
di_node->di.bParseTipperVarsFirst = false;
@@ -67,9 +67,9 @@ void CreateDefaultItems() if (subst == NULL) continue;
DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
- mir_tstrncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
+ _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
ds_node->ds.type = subst->type;
- mir_strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
+ strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
ds_node->next = opt.dsList;
opt.dsList = ds_node;
@@ -77,8 +77,8 @@ void CreateDefaultItems() }
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- mir_tstrncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
di_node->di.bLineAbove = false;
di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
di_node->di.bIsVisible = true;
@@ -100,7 +100,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- mir_tstrncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
+ _tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
db_free(&dbv);
@@ -110,7 +110,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
ds->szModuleName[0] = 0;
if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
- mir_strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
+ strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
db_free(&dbv);
}
@@ -118,7 +118,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
ds->szSettingName[0] = 0;
if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
- mir_strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
+ strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
db_free(&dbv);
}
@@ -161,14 +161,14 @@ bool LoadDI(DISPLAYITEM *di, int index) if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- mir_tstrncpy(di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
+ _tcsncpy(di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
- mir_tstrncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
+ _tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
db_free(&dbv);
}
@@ -411,8 +411,8 @@ void LoadOptions() di_node = opt.diList;
}
- mir_tstrncpy(di_node->di.swzLabel, _T("Last message: (%sys:last_msg_reltime% ago)"), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, _T("%sys:last_msg%"), VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, _T("Last message: (%sys:last_msg_reltime% ago)"), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T("%sys:last_msg%"), VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -436,8 +436,8 @@ void LoadOptions() di_node = opt.diList;
}
- mir_tstrncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -516,7 +516,7 @@ void LoadOptions() }
else if (opt.skinMode == SM_IMAGE) {
if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
- mir_tstrncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
+ _tcsncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
db_free(&dbv);
}
}
@@ -907,13 +907,13 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA memset(ds_value, 0, sizeof(DSListNode));
ds_value->next = NULL;
ds_value->ds.type = subst->type;
- mir_tstrncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
+ _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
if (ds_value->ds.type == DVT_DB && subst->szModuleName)
- mir_strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
+ strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
if (subst->szSettingName)
- mir_strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1);
+ strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1);
ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 24377573bf..1396836639 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -314,7 +314,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa db_unset(pwd->hContact, MODULE, "TempStatusMsg"); TCHAR *swzNick = pcli->pfnGetContactDisplayName(pwd->hContact, 0); - mir_tstrncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN); + _tcsncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN); char *szProto = GetContactProto(pwd->hContact); pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto); @@ -338,9 +338,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (iXstatus) { char szIconProto[64]; if (mir_strcmp(szProto, META_PROTO) != 0) - mir_strncpy(szIconProto, szProto, sizeof(szIconProto) - 1); + strncpy(szIconProto, szProto, sizeof(szIconProto) - 1); else if (!db_get_s(pwd->hContact, szProto, "XStatusProto", &dbv)) { - mir_strncpy(szIconProto, dbv.pszVal, sizeof(szIconProto) - 1); + strncpy(szIconProto, dbv.pszVal, sizeof(szIconProto) - 1); db_free(&dbv); } @@ -775,7 +775,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue); if (iLen) { if (iLen > MAX_VALUE_LEN) { - mir_tstrncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN); + _tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN); buff[MAX_VALUE_LEN] = 0; mir_tstrcat(buff, _T("...")); } diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 91740cf8af..998694c0e6 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -272,7 +272,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff else if (szProto) { PROTOACCOUNT *pa = ProtoGetAccount(szProto); if (pa && pa->tszAccountName) { - mir_tstrncpy(buff, pa->tszAccountName, bufflen); + _tcsncpy(buff, pa->tszAccountName, bufflen); return true; } else @@ -290,7 +290,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff else if (!mir_tstrcmp(swzRawSpec, _T("status_msg"))) { TCHAR *swzMsg = GetStatusMessageText(hContact); if (swzMsg) { - mir_tstrncpy(buff, swzMsg, bufflen); + _tcsncpy(buff, swzMsg, bufflen); mir_free(swzMsg); return true; } @@ -298,7 +298,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff else if ((recv = !mir_tstrcmp(swzRawSpec, _T("last_msg"))) || !mir_tstrcmp(swzRawSpec, _T("last_msg_out"))) { TCHAR *swzMsg = GetLastMessageText(hContact, recv); if (swzMsg) { - mir_tstrncpy(buff, swzMsg, bufflen); + _tcsncpy(buff, swzMsg, bufflen); mir_free(swzMsg); return true; } @@ -310,7 +310,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff return false; TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hSubContact, GCDNF_TCHAR); - if (swzNick) mir_tstrncpy(buff, swzNick, bufflen); + if (swzNick) _tcsncpy(buff, swzNick, bufflen); return true; } else if (!mir_tstrcmp(swzRawSpec, _T("meta_subuid"))) { @@ -581,7 +581,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (ds_node) GetSubstText(hContact, ds_node->ds, swzAlt, VALUE_LEN); else { - mir_tstrncpy(swzAlt, p, VALUE_LEN); + _tcsncpy(swzAlt, p, VALUE_LEN); bAltSubst = true; } } @@ -619,12 +619,12 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (bSubst) { size_t rep_len = mir_tstrlen(swzRep); - mir_tstrncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di)); + _tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di)); di += rep_len - 1; // -1 because we inc at bottom of loop } else if (bAltSubst) { size_t alt_len = mir_tstrlen(swzAlt); - mir_tstrncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di)); + _tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di)); di += alt_len - 1; // -1 because we inc at bottom of loop } else goto empty; // empty value @@ -643,7 +643,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (parseTipperVarsFirst) { swzVarSrc = variables_parsedup(swzDest, 0, hContact); - mir_tstrncpy(swzDest, swzVarSrc, iDestLen); + _tcsncpy(swzDest, swzVarSrc, iDestLen); mir_free(swzVarSrc); } diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 1d60bb3970..12ac692831 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -174,9 +174,9 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe if (dbv.type == DBVT_BYTE)
{
if (dbv.bVal != 0)
- mir_tstrncpy(buff, _T("Yes"), bufflen);
+ _tcsncpy(buff, _T("Yes"), bufflen);
else
- mir_tstrncpy(buff, _T("No"), bufflen);
+ _tcsncpy(buff, _T("No"), bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
return buff;
@@ -190,9 +190,9 @@ TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szS {
BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
- mir_tstrncpy(buff, TranslateT("Female"), bufflen);
+ _tcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
- mir_tstrncpy(buff, TranslateT("Male"), bufflen);
+ _tcsncpy(buff, TranslateT("Male"), bufflen);
else
return 0;
@@ -588,7 +588,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co {
if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
- mir_tstrncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ _tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -609,7 +609,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
- mir_tstrncpy(buff, TranslateTS(szDefaultName), bufflen);
+ _tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index bf6f30667e..e1ab66d706 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -73,32 +73,32 @@ CTooltipNotify::~CTooltipNotify() void CTooltipNotify::RegisterFonts()
{
FontIDT fontId = { sizeof(fontId) };
- mir_tstrncpy(fontId.group, FONTSERV_GROUP, SIZEOF(fontId.group)-1);
- mir_strncpy(fontId.dbSettingsGroup, MODULENAME, SIZEOF(fontId.dbSettingsGroup)-1);
+ _tcsncpy(fontId.group, FONTSERV_GROUP, SIZEOF(fontId.group)-1);
+ strncpy(fontId.dbSettingsGroup, MODULENAME, SIZEOF(fontId.dbSettingsGroup)-1);
fontId.flags = FIDF_DEFAULTVALID;
fontId.deffontsettings.colour = DEF_SETTING_TXTCOLOR;
fontId.deffontsettings.size = -MulDiv(DEF_SETTING_FONT_SIZE, DEF_LOGPIXELSY, 72);
fontId.deffontsettings.style = DEF_SETTING_FONT_STYLE;
fontId.deffontsettings.charset = DEF_SETTING_FONT_CHARSET;
- mir_tstrncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, SIZEOF(fontId.deffontsettings.szFace)-1);
+ _tcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, SIZEOF(fontId.deffontsettings.szFace)-1);
fontId.order = 0;
- mir_tstrncpy(fontId.backgroundGroup, FONTSERV_GROUP, SIZEOF(fontId.backgroundGroup)-1);
+ _tcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, SIZEOF(fontId.backgroundGroup)-1);
ColourIDT colorId = { sizeof(colorId) };
- mir_tstrncpy(colorId.group, FONTSERV_GROUP, SIZEOF(colorId.group)-1);
- mir_strncpy(colorId.dbSettingsGroup, MODULENAME, SIZEOF(colorId.dbSettingsGroup)-1);
+ _tcsncpy(colorId.group, FONTSERV_GROUP, SIZEOF(colorId.group)-1);
+ strncpy(colorId.dbSettingsGroup, MODULENAME, SIZEOF(colorId.dbSettingsGroup)-1);
colorId.flags = 0;
colorId.defcolour = DEF_SETTING_BGCOLOR;
colorId.order = 0;
for (int i=0; i<SIZEOF(s_fontTable); i++) {
- mir_tstrncpy(fontId.name, s_fontTable[i].name, SIZEOF(fontId.name)-1);
- mir_strncpy(fontId.prefix, s_fontTable[i].fontPrefix, SIZEOF(fontId.prefix)-1);
- mir_tstrncpy(fontId.backgroundName, s_fontTable[i].name, SIZEOF(fontId.backgroundName)-1);
+ _tcsncpy(fontId.name, s_fontTable[i].name, SIZEOF(fontId.name)-1);
+ strncpy(fontId.prefix, s_fontTable[i].fontPrefix, SIZEOF(fontId.prefix)-1);
+ _tcsncpy(fontId.backgroundName, s_fontTable[i].name, SIZEOF(fontId.backgroundName)-1);
::FontRegisterT(&fontId);
- mir_tstrncpy(colorId.name, s_fontTable[i].name, SIZEOF(colorId.name)-1);
- mir_strncpy(colorId.setting, s_fontTable[i].clrPrefix, SIZEOF(colorId.setting)-1);
+ _tcsncpy(colorId.name, s_fontTable[i].name, SIZEOF(colorId.name)-1);
+ strncpy(colorId.setting, s_fontTable[i].clrPrefix, SIZEOF(colorId.setting)-1);
::ColourRegisterT(&colorId);
}
}
@@ -120,10 +120,10 @@ void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* // name and group only
FontIDT fontId = { sizeof(fontId), FONTSERV_GROUP, 0 };
- mir_tstrncpy(fontId.name, fontName,SIZEOF(fontId.name)-1);
+ _tcsncpy(fontId.name, fontName,SIZEOF(fontId.name)-1);
*text = (COLORREF)::CallService(MS_FONT_GETT, (WPARAM)&fontId, (LPARAM)lf);
ColourIDT colorId = { sizeof(colorId), FONTSERV_GROUP, 0 };
- mir_tstrncpy(colorId.name, fontName,SIZEOF(colorId.name)-1);
+ _tcsncpy(colorId.name, fontName,SIZEOF(colorId.name)-1);
*bg = (COLORREF)::CallService(MS_COLOUR_GETT, (WPARAM)&colorId, 0);
}
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index c728572581..22caa0e3c2 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -455,10 +455,10 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) rq.hDC = hdc;
rq.rcDestRect = rect;
rq.rcClipRect = rect;
- mir_strncpy(rq.szObjectID, "Main,ID=EventArea", sizeof(rq.szObjectID));
+ strncpy(rq.szObjectID, "Main,ID=EventArea", sizeof(rq.szObjectID));
if (CallService(MS_SKIN_DRAWGLYPH, (WPARAM)&rq, 0))
{
- mir_strncpy(rq.szObjectID, "Main,ID=StatusBar", sizeof(rq.szObjectID));
+ strncpy(rq.szObjectID, "Main,ID=StatusBar", sizeof(rq.szObjectID));
CallService(MS_SKIN_DRAWGLYPH, (WPARAM)&rq, 0);
}
}
@@ -1136,7 +1136,7 @@ void NotifyOnSend(void) memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
- mir_tstrncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
//
mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), TranslateT("%d kilobytes sent"),
notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
@@ -1155,7 +1155,7 @@ void NotifyOnRecv(void) memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
- mir_tstrncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"),MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"),MAX_CONTACTNAME);
//
mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), TranslateT("%d kilobytes received"),
notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index 51fb9e96b9..196ec13abb 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -60,7 +60,7 @@ WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList) // Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
(*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * (begin - end));
// Êîïèðóåì ñòðîêó.
- mir_tstrncpy((*RowItemsList)[c].String, end + 1, begin - end - 1);
+ _tcsncpy((*RowItemsList)[c].String, end + 1, begin - end - 1);
(*RowItemsList)[c].String[begin - end - 1] = 0;
}
else
@@ -68,7 +68,7 @@ WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList) // Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
(*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * mir_tstrlen(end));
// Êîïèðóåì ñòðîêó.
- mir_tstrncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
+ _tcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
}
c++;
@@ -264,7 +264,7 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, WORD Siz if (Size && Buffer)
{
- mir_tstrncpy(Buffer, Res, Size);
+ _tcsncpy(Buffer, Res, Size);
Length = mir_tstrlen(Buffer);
}
else
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 9c75a55b85..91de3fec58 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -44,13 +44,13 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) if (pszDivider == NULL)
{
mir_tstrcpy(pszDirName, _T(""));
- mir_tstrncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
+ _tcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
}
else
{
- mir_tstrncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
+ _tcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
pszFileName[mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1] = 0;
- mir_tstrncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
+ _tcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
pszDirName[pszDivider - ptszHelpFile] = 0;
}
}
diff --git a/plugins/Utils/mir_buffer.h b/plugins/Utils/mir_buffer.h index 127892a965..5391b1bcf4 100644 --- a/plugins/Utils/mir_buffer.h +++ b/plugins/Utils/mir_buffer.h @@ -70,7 +70,7 @@ static void __bcopy(D *dest, const O *orig, size_t len) template<>
static void __bcopy(char *dest, const char *orig, size_t len)
{
- mir_strncpy(dest, orig, len);
+ strncpy(dest, orig, len);
}
template<>
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp index f0d745f95e..d08a05a2ec 100644 --- a/plugins/Variables/src/parse_alias.cpp +++ b/plugins/Variables/src/parse_alias.cpp @@ -62,7 +62,7 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg) return NULL;
}
memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(TCHAR));
- mir_tstrncpy(res + cur, rArg, mir_tstrlen(rArg));
+ _tcsncpy(res + cur, rArg, mir_tstrlen(rArg));
}
}
cur++;
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index d0f128d731..c1c6f405ac 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -41,7 +41,7 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) char hex[8];
memmove(res + cur + 3, res + cur + 1, mir_strlen(res + cur + 1) + 1);
mir_snprintf(hex, SIZEOF(hex), "%%%x", *(res + cur));
- mir_strncpy(res + cur, hex, mir_strlen(hex));
+ strncpy(res + cur, hex, mir_strlen(hex));
cur += mir_strlen(hex);
}
@@ -64,7 +64,7 @@ static TCHAR *parseUrlDec(ARGUMENTSINFO *ai) if ((*(res + cur) == '%') && (mir_strlen(res + cur) >= 3)) {
char hex[8];
memset(hex, '\0', sizeof(hex));
- mir_strncpy(hex, res + cur + 1, 2);
+ strncpy(hex, res + cur + 1, 2);
*(res + cur) = (char)strtol(hex, NULL, 16);
memmove(res + cur + 1, res + cur + 3, mir_strlen(res + cur + 3) + 1);
}
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index 4e1b65f725..a8903e89f0 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -118,7 +118,7 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai) return res;
memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(TCHAR)));
- mir_tstrncpy(res, ai->targv[1], cur - ai->targv[1]);
+ _tcsncpy(res, ai->targv[1], cur - ai->targv[1]);
mir_tstrcat(res, szReplacement);
return res;
}
@@ -169,7 +169,7 @@ static TCHAR *parseInsert(ARGUMENTSINFO *ai) return NULL;
memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(TCHAR)));
- mir_tstrncpy(res, ai->targv[1], pos);
+ _tcsncpy(res, ai->targv[1], pos);
mir_tstrcpy(res + pos, ai->targv[2]);
mir_tstrcpy(res + pos + mir_tstrlen(ai->targv[2]), ai->targv[1] + pos);
return res;
@@ -190,7 +190,7 @@ static TCHAR *parseLeft(ARGUMENTSINFO *ai) return NULL;
memset(res, 0, ((len + 1) * sizeof(TCHAR)));
- mir_tstrncpy(res, ai->targv[1], len);
+ _tcsncpy(res, ai->targv[1], len);
return res;
}
@@ -334,7 +334,7 @@ static TCHAR *parsePadcut(ARGUMENTSINFO *ai) *cur++ = padchar;
if (padding > addcount)
- mir_tstrncpy(res + addcount, ai->targv[1], padding - addcount);
+ _tcsncpy(res + addcount, ai->targv[1], padding - addcount);
return res;
}
@@ -363,7 +363,7 @@ static TCHAR *parsePadcutright(ARGUMENTSINFO *ai) *cur++ = padchar;
if (padding > addcount)
- mir_tstrncpy(res, ai->targv[1], padding - addcount);
+ _tcsncpy(res, ai->targv[1], padding - addcount);
return res;
}
@@ -434,7 +434,7 @@ static TCHAR *parseRight(ARGUMENTSINFO *ai) return NULL;
memset(res, 0, ((len + 1)*sizeof(TCHAR)));
- mir_tstrncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
+ _tcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
return res;
}
@@ -603,7 +603,7 @@ static TCHAR *parseSubstr(ARGUMENTSINFO *ai) TCHAR *res = (TCHAR*)mir_alloc((to - from + 1)*sizeof(TCHAR));
memset(res, 0, ((to - from + 1) * sizeof(TCHAR)));
- mir_tstrncpy(res, ai->targv[1] + from, to - from);
+ _tcsncpy(res, ai->targv[1] + from, to - from);
return res;
}
@@ -652,7 +652,7 @@ static TCHAR *parseTrim(ARGUMENTSINFO *ai) return NULL;
memset(res, 0, ((ecur - scur + 2) * sizeof(TCHAR)));
- mir_tstrncpy(res, scur, ecur - scur + 1);
+ _tcsncpy(res, scur, ecur - scur + 1);
return res;
}
@@ -723,7 +723,7 @@ static TCHAR *getNthWord(TCHAR *szString, int w) return NULL;
memset(res, 0, ((ecur - scur + 1) * sizeof(TCHAR)));
- mir_tstrncpy(res, scur, ecur - scur);
+ _tcsncpy(res, scur, ecur - scur);
return res;
}
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index b815f8f104..73c83cf22e 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -182,7 +182,7 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai) break;
TCHAR *res = (TCHAR*)mir_alloc((ei - bi + 1) * sizeof(TCHAR));
- mir_tstrncpy(res, ai->targv[1] + bi, ei - bi);
+ _tcsncpy(res, ai->targv[1] + bi, ei - bi);
res[ei - bi] = 0;
return res;
}
@@ -218,7 +218,7 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- mir_tstrncpy(res, ai->targv[1], (ecur - ai->targv[1]) + 1);
+ _tcsncpy(res, ai->targv[1], (ecur - ai->targv[1]) + 1);
return res;
}
@@ -371,7 +371,7 @@ static TCHAR *parseListDir(ARGUMENTSINFO *ai) tszRes = NULL;
if (ai->argc > 1)
- mir_tstrncpy(tszFirst, ai->targv[1], SIZEOF(tszFirst) - 1);
+ _tcsncpy(tszFirst, ai->targv[1], SIZEOF(tszFirst) - 1);
if (ai->argc > 2)
tszFilter = ai->targv[2];
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index 4e38a5194f..3c5652f6f1 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -92,7 +92,7 @@ TCHAR* getArguments(TCHAR *string, TCHAR ***aargv, int *aargc) } memset(argv[argc], '\0', (cur-(scur+1)+1)*sizeof(TCHAR)); - mir_tstrncpy(argv[argc], scur+1, cur-(scur+1)); + _tcsncpy(argv[argc], scur+1, cur-(scur+1)); } else argv[argc] = mir_tstrdup(_T("")); @@ -233,7 +233,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) return NULL; } memset(token, '\0', (tcur-scur+1)*sizeof(TCHAR)); - mir_tstrncpy(token, cur+1, tcur-scur); + _tcsncpy(token, cur+1, tcur-scur); // cur points to FIELD_CHAR or FUNC_CHAR tmpVarPos = -1; tr = NULL; diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index ab22d58b7a..5f2fd10f6b 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -71,7 +71,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) // set contact info and settings
TCHAR svc[256];
- mir_tstrncpy(svc, psr->email, SIZEOF(svc)); svc[SIZEOF(svc)-1] = 0;
+ _tcsncpy(svc, psr->email, SIZEOF(svc)); svc[SIZEOF(svc)-1] = 0;
GetSvc(svc);
// set settings by obtaining the default for the service
if (psr->lastName[0] != 0) {
@@ -156,7 +156,7 @@ static void __cdecl BasicSearchTimerProc(LPVOID hWnd) INT_PTR WeatherBasicSearch(WPARAM wParam, LPARAM lParam)
{
if (searchId != -1) return 0; //only one search at a time
- mir_tstrncpy(sID, ( TCHAR* )lParam, SIZEOF(sID));
+ _tcsncpy(sID, ( TCHAR* )lParam, SIZEOF(sID));
sID[SIZEOF(sID)-1] = 0;
searchId = 1;
// create a thread for the ID search
@@ -250,7 +250,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, }
// give no station name but only ID if the search is unavailable
- else mir_tstrncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
+ else _tcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
mir_sntprintf(newID, SIZEOF(newID), _T("%s/%s"), svc, sID);
// set the search result and broadcast it
@@ -344,7 +344,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if can't get the name, use the search string as name
if (Name[0] == 0)
- mir_tstrncpy(Name, name, SIZEOF(Name));
+ _tcsncpy(Name, name, SIZEOF(Name));
// set the data and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
@@ -383,7 +383,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if can't get the name, use the search string as name
if (Name[0] == 0)
- mir_tstrncpy(Name, name, SIZEOF(Name));
+ _tcsncpy(Name, name, SIZEOF(Name));
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 947378c026..5eec260dd7 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -293,15 +293,15 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa ofn.lpstrFile = str;
ofn.nMaxFile = SIZEOF(str);
// set filters
- mir_tstrncpy(filter, TranslateT("Text Files"), SIZEOF(filter) - 1);
+ _tcsncpy(filter, TranslateT("Text Files"), SIZEOF(filter) - 1);
mir_tstrncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter)+1;
- mir_tstrncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1);
+ _tcsncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter)+1;
- mir_tstrncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1);
+ _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1);
mir_tstrncat(pfilter, _T(" (*.*)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = pfilter + mir_tstrlen(pfilter)+1;
- mir_tstrncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1);
+ _tcsncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter)+1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
@@ -452,7 +452,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) // if the station is not a default station, set it as the new default station
// this is the first weather station encountered from the search
if ( mir_tstrcmp(opt.Default, dbv.ptszVal)) {
- mir_tstrncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
+ _tcsncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
opt.DefStn = hContact;
db_free(&dbv);
if ( !db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 9e5d3be614..f47db595de 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -50,35 +50,35 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact) GetStationID(hContact, winfo.id, SIZEOF(winfo.id));
if (DBGetStaticString(hContact, WEATHERPROTONAME, "Nick", winfo.city, SIZEOF(winfo.city)))
- mir_tstrncpy(winfo.city, NODATA, SIZEOF(winfo.city) - 1);
+ _tcsncpy(winfo.city, NODATA, SIZEOF(winfo.city) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Update", winfo.update, SIZEOF(winfo.update)))
- mir_tstrncpy(winfo.update, NODATA, SIZEOF(winfo.update) - 1);
+ _tcsncpy(winfo.update, NODATA, SIZEOF(winfo.update) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Condition", winfo.cond, SIZEOF(winfo.cond)))
- mir_tstrncpy(winfo.cond, NODATA, SIZEOF(winfo.cond) - 1);
+ _tcsncpy(winfo.cond, NODATA, SIZEOF(winfo.cond) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Temperature", winfo.temp, SIZEOF(winfo.temp)))
- mir_tstrncpy(winfo.temp, NODATA, SIZEOF(winfo.temp) - 1);
+ _tcsncpy(winfo.temp, NODATA, SIZEOF(winfo.temp) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "High", winfo.high, SIZEOF(winfo.high)))
- mir_tstrncpy(winfo.high, NODATA, SIZEOF(winfo.high) - 1);
+ _tcsncpy(winfo.high, NODATA, SIZEOF(winfo.high) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Low", winfo.low, SIZEOF(winfo.low)))
- mir_tstrncpy(winfo.low, NODATA, SIZEOF(winfo.low) - 1);
+ _tcsncpy(winfo.low, NODATA, SIZEOF(winfo.low) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, SIZEOF(winfo.sunset)))
- mir_tstrncpy(winfo.sunset, NODATA, SIZEOF(winfo.sunset) - 1);
+ _tcsncpy(winfo.sunset, NODATA, SIZEOF(winfo.sunset) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, SIZEOF(winfo.sunrise)))
- mir_tstrncpy(winfo.sunrise, NODATA, SIZEOF(winfo.sunrise) - 1);
+ _tcsncpy(winfo.sunrise, NODATA, SIZEOF(winfo.sunrise) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, SIZEOF(winfo.wind)))
- mir_tstrncpy(winfo.wind, NODATA, SIZEOF(winfo.wind) - 1);
+ _tcsncpy(winfo.wind, NODATA, SIZEOF(winfo.wind) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, SIZEOF(winfo.winddir)))
- mir_tstrncpy(winfo.winddir, NODATA, SIZEOF(winfo.winddir) - 1);
+ _tcsncpy(winfo.winddir, NODATA, SIZEOF(winfo.winddir) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, SIZEOF(winfo.dewpoint)))
- mir_tstrncpy(winfo.dewpoint, NODATA, SIZEOF(winfo.dewpoint) - 1);
+ _tcsncpy(winfo.dewpoint, NODATA, SIZEOF(winfo.dewpoint) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, SIZEOF(winfo.pressure)))
- mir_tstrncpy(winfo.pressure, NODATA, SIZEOF(winfo.pressure) - 1);
+ _tcsncpy(winfo.pressure, NODATA, SIZEOF(winfo.pressure) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Visibility", winfo.vis, SIZEOF(winfo.vis)))
- mir_tstrncpy(winfo.vis, NODATA, SIZEOF(winfo.vis) - 1);
+ _tcsncpy(winfo.vis, NODATA, SIZEOF(winfo.vis) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Humidity", winfo.humid, SIZEOF(winfo.humid)))
- mir_tstrncpy(winfo.humid, NODATA, SIZEOF(winfo.humid) - 1);
+ _tcsncpy(winfo.humid, NODATA, SIZEOF(winfo.humid) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Feel", winfo.feel, SIZEOF(winfo.feel)))
- mir_tstrncpy(winfo.feel, NODATA, SIZEOF(winfo.feel) - 1);
+ _tcsncpy(winfo.feel, NODATA, SIZEOF(winfo.feel) - 1);
winfo.status = (WORD)db_get_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
return winfo;
@@ -106,7 +106,7 @@ int DBGetStaticString(MCONTACT hContact, const char *szModule, const char *value if ( db_get_ts( hContact, szModule, valueName, &dbv ))
return 1;
- mir_tstrncpy( dest, dbv.ptszVal, dest_len );
+ _tcsncpy( dest, dbv.ptszVal, dest_len );
dest[ dest_len-1 ] = 0;
db_free( &dbv );
return 0;
@@ -176,7 +176,7 @@ void EraseAllInfo() // in case where the default station is missing
if (opt.DefStn == NULL && ContactCount != 0) {
if ( !db_get_ts(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
- mir_tstrncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
+ _tcsncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
db_free(&dbv);
}
opt.DefStn = LastContact;
@@ -340,7 +340,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData) mir_sntprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name);
WPShowMessage(Data, SM_WARNING);
}
- mir_tstrncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
+ _tcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
last = ' ';
respos = MAX_DATA_LEN - 1;
break;
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index 4ceeb921ae..39e41637c7 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -216,7 +216,7 @@ void MoreVarList(void) TCHAR str[10240], tempstr[1024];
// heading
- mir_tstrncpy(str, VARS_LIST, SIZEOF(str) - 1);
+ _tcsncpy(str, VARS_LIST, SIZEOF(str) - 1);
mir_tstrncat(str, _T("\n\n"), SIZEOF(str) - mir_tstrlen(str));
// loop through all weather services to find custom variables
for (WIDATALIST *Item = WIHead;Item != NULL;Item = Item->next)
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index fa689562e0..9e636102dd 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -184,7 +184,7 @@ bool LoadWIData(bool dial) return false;
*chop = '\0';
mir_tstrncat(szSearchPath, _T("\\Plugins\\Weather\\*.ini"), SIZEOF(szSearchPath) - mir_tstrlen(szSearchPath));
- mir_tstrncpy(FileName, szSearchPath, MAX_PATH - 1);
+ _tcsncpy(FileName, szSearchPath, MAX_PATH - 1);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szSearchPath, &fd);
@@ -351,7 +351,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) if (Line[1] != '/') { // if it is not a footer (for old ini)
// save the group name
Temp = (char *)mir_alloc(mir_strlen(Line)+10);
- mir_strncpy(Temp, Line+1, chop-Line-1);
+ strncpy(Temp, Line+1, chop-Line-1);
Temp[chop-Line-1] = 0;
wfree(&Group);
wSetData(&Group, Temp);
@@ -381,7 +381,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) // get the string before '=' (ValName) and after '=' (Value)
ValName = (char *)mir_alloc(mir_strlen(Line)+1);
- mir_strncpy(ValName, Line, Value-Line);
+ strncpy(ValName, Line, Value-Line);
ValName[Value-Line] = 0;
Value++;
ConvertBackslashes(Value);
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 57e6b3fabb..77cc37b97a 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -36,43 +36,43 @@ void SetTextDefault(const char* in) TCHAR str[MAX_TEXT_SIZE];
if (strchr(in, 'C') != NULL) {
- mir_tstrncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.cText, str);
}
if (strchr(in, 'b') != NULL) {
- mir_tstrncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bTitle, str);
}
if (strchr(in, 'B') != NULL) {
- mir_tstrncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bText, str);
}
if (strchr(in, 'N') != NULL) {
- mir_tstrncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.nText, str);
}
if (strchr(in, 'E') != NULL) {
- mir_tstrncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.eText, str);
}
if (strchr(in, 'H') != NULL) {
- mir_tstrncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.hText, str);
}
if (strchr(in, 'X') != NULL) {
- mir_tstrncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.xText, str);
}
if (strchr(in, 'P') != NULL) {
- mir_tstrncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pTitle, str);
}
if (strchr(in, 'p') != NULL) {
- mir_tstrncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pText, str);
}
if (strchr(in, 'S') != NULL) {
- mir_tstrncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
+ _tcsncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.sText, str);
}
}
@@ -472,7 +472,7 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowPos(hdlg, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE);
TranslateDialogDefault(hdlg);
// generate the display text for variable list
- mir_tstrncpy(str, VAR_LIST_OPT, SIZEOF(str) - 1);
+ _tcsncpy(str, VAR_LIST_OPT, SIZEOF(str) - 1);
SetDlgItemText(hdlg, IDC_VARLIST, str);
// make the more variable and other buttons flat
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 9abcac9dda..17ab3696c8 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -79,8 +79,8 @@ int WeatherError(WPARAM wParam, LPARAM lParam) TCHAR str1[512], str2[512];
// get the 2 strings
- mir_tstrncpy(str1, tszMsg, SIZEOF(str1) - 1);
- mir_tstrncpy(str2, tszMsg, SIZEOF(str2) - 1);
+ _tcsncpy(str1, tszMsg, SIZEOF(str1) - 1);
+ _tcsncpy(str2, tszMsg, SIZEOF(str2) - 1);
TCHAR *chop = _tcschr(str1, 255);
if (chop != NULL)
*chop = '\0';
@@ -88,7 +88,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam) str1[0] = 0;
chop = _tcschr(str2, 255);
if (chop != NULL)
- mir_tstrncpy(str2, chop+1, SIZEOF(str2) - 1);
+ _tcsncpy(str2, chop+1, SIZEOF(str2) - 1);
else
str2[0] = 0;
@@ -396,7 +396,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_VAR3:
// display variable list
- mir_tstrncpy(str, _T(" \n"),SIZEOF(str) - 1); // to make the message box wider
+ _tcsncpy(str, _T(" \n"),SIZEOF(str) - 1); // to make the message box wider
mir_tstrncat(str, VAR_LIST_POPUP, SIZEOF(str) - mir_tstrlen(str));
mir_tstrncat(str, _T("\n"), SIZEOF(str) - mir_tstrlen(str));
mir_tstrncat(str, CUSTOM_VARS, SIZEOF(str) - mir_tstrlen(str));
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 73bd25a76b..b485257601 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -90,7 +90,7 @@ INT_PTR WeatherGetCaps(WPARAM wParam, LPARAM lParam) // protocol service function to get weather protocol name
INT_PTR WeatherGetName(WPARAM wParam,LPARAM lParam)
{
- mir_strncpy((char*)lParam,WEATHERPROTOTEXT,wParam-1);
+ strncpy((char*)lParam,WEATHERPROTOTEXT,wParam-1);
*((char*)lParam + wParam-1) = 0;
return 0;
}
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 6a8890b62d..ed9275e2c4 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -460,7 +460,7 @@ int GetWeatherData(MCONTACT hContact) // to get a data value.
GetDataValue(&Item->Item, DataValue, &szInfo);
if ( mir_tstrcmp(Item->Item.Name, _T("Condition")) && mir_tstrcmpi(Item->Item.Unit, _T("Cond")))
- mir_tstrncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
+ _tcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
break;
case WID_SET:
@@ -482,7 +482,7 @@ int GetWeatherData(MCONTACT hContact) chop = _tcschr(str, '\0');
stl = min(sizeof(str2)-1, (unsigned)(chop-str-2));
- mir_tstrncpy(str2, str+1, stl);
+ _tcsncpy(str2, str+1, stl);
str2[stl] = 0;
switch(str[0]) {
@@ -513,7 +513,7 @@ int GetWeatherData(MCONTACT hContact) // for the "Break Data=" operation
DBVARIANT dbv;
if ( !DBGetData(hContact, _T2A(Item->Item.Start), &dbv)) {
- mir_tstrncpy(DataValue, dbv.ptszVal, SIZEOF(DataValue));
+ _tcsncpy(DataValue, dbv.ptszVal, SIZEOF(DataValue));
DataValue[SIZEOF(DataValue)-1] = 0;
db_free(&dbv);
}
diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index 444ee9f135..befe325ad0 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -336,7 +336,7 @@ void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact) winfo = LoadWeatherInfo(hContact);
// check if data exist. If not, display error message box
if ( !(BOOL)db_get_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE))
- mir_tstrncpy(str, WEATHER_NO_INFO, SIZEOF(str) - 1);
+ _tcsncpy(str, WEATHER_NO_INFO, SIZEOF(str) - 1);
else
// set the display text and show the message box
GetDisplay(&winfo, opt.bText, str);
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index ed6169c3d9..feffb27c1f 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -272,7 +272,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn memset(&tempraw, 0, sizeof(tempraw));
memset(&raw, 0, sizeof(raw));
- mir_strncpy(tempraw, truncated, SIZEOF(tempraw));
+ strncpy(tempraw, truncated, SIZEOF(tempraw));
memset(&alertstring, 0, sizeof(alertstring));
memset(&Alerttempstring, 0, sizeof(Alerttempstring));
@@ -562,7 +562,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn disalertpos = 0;
//write selected data to string
- mir_strncpy(raw, &tempraw[statalertpos], (statalertposend - statalertpos));
+ strncpy(raw, &tempraw[statalertpos], (statalertposend - statalertpos));
raw[(statalertposend - statalertpos)] = '\0';
}
} // end putting data into string
@@ -760,7 +760,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
}
}
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
return wasAlert;
}
diff --git a/plugins/WebView/src/webview_cleanup.cpp b/plugins/WebView/src/webview_cleanup.cpp index b645cb5e5d..67a4ee5a1d 100644 --- a/plugins/WebView/src/webview_cleanup.cpp +++ b/plugins/WebView/src/webview_cleanup.cpp @@ -386,7 +386,7 @@ void CodetoSymbol(char *truncated) }
truncated[(position + counter) - 1] = Characters[n];
- mir_strncpy(&truncated[position], &truncated[position + mir_strlen(CharacterCodes[n])] - 1, mir_strlen(&truncated[position]) - 1);
+ strncpy(&truncated[position], &truncated[position + mir_strlen(CharacterCodes[n])] - 1, mir_strlen(&truncated[position]) - 1);
} // end does character code exist?
if (recpos == position)
@@ -407,7 +407,7 @@ void EraseBlock(char *truncated) char* tempraw = (char*)malloc(MAXSIZE1);
if (truncated)
- mir_strncpy(tempraw, truncated, MAXSIZE1);
+ strncpy(tempraw, truncated, MAXSIZE1);
// ///////////////////////////
@@ -584,7 +584,7 @@ void EraseBlock(char *truncated) positionStart = 0;
positionEnd = 0;
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
free(tempraw);
}
@@ -597,7 +597,7 @@ void EraseSymbols(char *truncated) char *tempraw = (char*)malloc(MAXSIZE1);
if (truncated)
- mir_strncpy(tempraw, truncated, MAXSIZE1);
+ strncpy(tempraw, truncated, MAXSIZE1);
// //////
while (true) {
@@ -625,7 +625,7 @@ void EraseSymbols(char *truncated) recpos = position;
}
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
free(tempraw);
}
@@ -640,7 +640,7 @@ void NumSymbols(char *truncated) char *tempraw = (char*)malloc(MAXSIZE1);
if (truncated)
- mir_strncpy(tempraw, truncated, MAXSIZE1);
+ strncpy(tempraw, truncated, MAXSIZE1);
while (true) {
Sleep(1); // avoid 100% CPU
@@ -678,7 +678,7 @@ void NumSymbols(char *truncated) recpos = position;
}
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
free(tempraw);
}
@@ -687,7 +687,7 @@ void FastTagFilter(char *truncated) {
char *tempraw = (char*)malloc(MAXSIZE1);
if (truncated)
- mir_strncpy(tempraw, truncated, MAXSIZE1);
+ strncpy(tempraw, truncated, MAXSIZE1);
for (int counter = 0; counter < mir_strlen(tempraw); counter++) {
if (tempraw[counter] == '<') {
@@ -703,7 +703,7 @@ void FastTagFilter(char *truncated) }
}
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
free(tempraw);
}
@@ -715,7 +715,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem) char *tempraw = (char*)malloc(MAXSIZE1);
if (truncated)
- mir_strncpy(tempraw, truncated, MAXSIZE1);
+ strncpy(tempraw, truncated, MAXSIZE1);
switch (AmountWspcRem) {
case 1:
@@ -745,7 +745,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem) tempraw[counter] = ' ';
} // end for
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
free(tempraw);
}
@@ -754,13 +754,13 @@ void RemoveTabs(char *truncated) {
char *tempraw = (char*)malloc(MAXSIZE1);
if (truncated)
- mir_strncpy(tempraw, truncated, MAXSIZE1);
+ strncpy(tempraw, truncated, MAXSIZE1);
for (int counter = 0; counter < mir_strlen(tempraw); counter++)
if (tempraw[counter] == '\t')
tempraw[counter] = ' ';
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
free(tempraw);
}
@@ -779,7 +779,7 @@ void Removewhitespace(char *truncated) counter2++;
pos2 = counter2;
- mir_strncpy(&truncated[pos1], &truncated[pos2], mir_strlen(&truncated[pos1]) - 1);
+ strncpy(&truncated[pos1], &truncated[pos2], mir_strlen(&truncated[pos1]) - 1);
} // end if
} // end for
}
@@ -788,11 +788,11 @@ void Removewhitespace(char *truncated) void Filter(char *truncated)
{
char tempraw[MAXSIZE1];
- mir_strncpy(tempraw, truncated, SIZEOF(tempraw));
+ strncpy(tempraw, truncated, SIZEOF(tempraw));
for (int counter = 0; counter < mir_strlen(tempraw); counter++)
if ((tempraw[counter] == '\n') || (tempraw[counter] == '\r') || (tempraw[counter] == '\t'))
- mir_strncpy(&tempraw[counter], &tempraw[counter + 1], mir_strlen(&tempraw[counter]) - 1);
+ strncpy(&tempraw[counter], &tempraw[counter + 1], mir_strlen(&tempraw[counter]) - 1);
- mir_strncpy(truncated, tempraw, mir_strlen(truncated));
+ strncpy(truncated, tempraw, mir_strlen(truncated));
}
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index eaa1728cc3..8857e78d1a 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -58,7 +58,7 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara char *tempbuffer = (char*)malloc(len + 2);
GetDlgItemTextA(ParentHwnd, IDC_DATA, tempbuffer, len);
- mir_strncpy(buff, tempbuffer, SIZEOF(buff));
+ strncpy(buff, tempbuffer, SIZEOF(buff));
free(tempbuffer);
Filter(buff);
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 3c01680add..a542e21c0a 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -225,7 +225,7 @@ void GetData(void *param) }
dispos = 0;
- mir_strncpy(raw, &truncated2[statpos], MallocSize);
+ strncpy(raw, &truncated2[statpos], MallocSize);
raw[MallocSize] = '\0';
trunccount = 0;
@@ -334,7 +334,7 @@ void GetData(void *param) eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0);
if (eventIndex == 2) {
- mir_strncpy(buff, truncated, SIZEOF(buff));
+ strncpy(buff, truncated, SIZEOF(buff));
Filter(buff);
if (!db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) {
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 36c4ceb4d2..77438d6ccc 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -172,7 +172,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam) return 0; TCHAR Cnick[200], *Oldnick; - mir_tstrncpy(Cnick, url, SIZEOF(Cnick)); + _tcsncpy(Cnick, url, SIZEOF(Cnick)); if ((Oldnick = _tcsstr(Cnick, _T("://"))) != 0) Oldnick += 3; else @@ -380,7 +380,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) //Convert url into a name for contact TCHAR Cnick[255]; if (psr->nick != NULL) - mir_tstrncpy(Cnick, psr->nick, SIZEOF(Cnick)); + _tcsncpy(Cnick, psr->nick, SIZEOF(Cnick)); else Cnick[0] = 0; diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp index 68f2e6fb15..79c518246d 100644 --- a/plugins/WhenWasIt/src/notifiers.cpp +++ b/plugins/WhenWasIt/src/notifiers.cpp @@ -35,8 +35,8 @@ void PopupNotifyNoBirthdays() FillPopupData(pd, -1);
pd.lchIcon = GetDTBIcon(-1);
- mir_tstrncpy(pd.lptzContactName, TranslateT("WhenWasIt"), MAX_CONTACTNAME - 1);
- mir_tstrncpy(pd.lptzText, TranslateT("No upcoming birthdays."), MAX_SECONDLINE - 1);
+ _tcsncpy(pd.lptzContactName, TranslateT("WhenWasIt"), MAX_CONTACTNAME - 1);
+ _tcsncpy(pd.lptzText, TranslateT("No upcoming birthdays."), MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
}
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 4eebe0aaa1..79c699d7de 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -180,8 +180,8 @@ void ShowPopupMessage(TCHAR *title, TCHAR *message, HANDLE icon) {
POPUPDATAT pd = { 0 };
pd.lchIcon = Skin_GetIconByHandle(icon);
- mir_tstrncpy(pd.lptzContactName, title, MAX_CONTACTNAME - 1);
- mir_tstrncpy(pd.lptzText, message, MAX_SECONDLINE - 1);
+ _tcsncpy(pd.lptzContactName, title, MAX_CONTACTNAME - 1);
+ _tcsncpy(pd.lptzText, message, MAX_SECONDLINE - 1);
pd.colorText = commonData.foreground;
pd.colorBack = commonData.background;
PUAddPopupT(&pd);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 5d78e81a7b..42bf4be905 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -94,14 +94,14 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) {
char buffer[32] = { 0 };
mir_strcpy(buffer, "0x");
- mir_strncpy(buffer + 2, inData, HEX_SIZE);
+ strncpy(buffer + 2, inData, HEX_SIZE);
sscanf(buffer, "%x", &size);
outData = (unsigned char*)new char[size * 2];
char *tmp = inData + HEX_SIZE;
buffer[4] = '\0'; //mark the end of the string
for (UINT i = 0; i < size; i++) {
- mir_strncpy(buffer + 2, &tmp[i * 2], 2);
+ strncpy(buffer + 2, &tmp[i * 2], 2);
sscanf(buffer, "%x", &outData[i]);
}
}
@@ -116,7 +116,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName res = 0;
size_t tmp = mir_strlen(dbv.pszVal);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_strncpy(szResult, dbv.pszVal, len);
+ strncpy(szResult, dbv.pszVal, len);
szResult[len] = '\0';
mir_free(dbv.pszVal);
}
@@ -125,7 +125,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName if (szError) {
size_t tmp = mir_strlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_strncpy(szResult, szError, len);
+ strncpy(szResult, szError, len);
szResult[len] = '\0';
}
else szResult[0] = '\0';
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index d408aeda61..294372504a 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -28,7 +28,7 @@ void LoadOptions() memset(&WumfOptions, 0, sizeof(WumfOptions));
if (db_get_ts(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
{
- mir_tstrncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
+ _tcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
db_free(&dbv);
}
else
diff --git a/plugins/XSoundNotify/src/Common.h b/plugins/XSoundNotify/src/Common.h index c776482380..4cbed8f0fb 100644 --- a/plugins/XSoundNotify/src/Common.h +++ b/plugins/XSoundNotify/src/Common.h @@ -31,7 +31,7 @@ struct XSN_Data __forceinline XSN_Data(MCONTACT _aContact, TCHAR *_path, BYTE _ignore) :
hContact(_aContact)
{
- mir_tstrncpy(path, _path, SIZEOF(path));
+ _tcsncpy(path, _path, SIZEOF(path));
ignore = _ignore;
}
};
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 2abe6cf9d9..00a777b36b 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -122,7 +122,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL)
XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
else {
- mir_tstrncpy(p->path, FileName, SIZEOF(p->path));
+ _tcsncpy(p->path, FileName, SIZEOF(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 0c1c963951..d85991de2e 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -144,7 +144,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
else
{
- mir_tstrncpy(p->path, FileName, SIZEOF(p->path));
+ _tcsncpy(p->path, FileName, SIZEOF(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index efece9892f..ece3465f5f 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -1073,7 +1073,7 @@ ULONGLONG MimeDateToFileTime(char *datein) if (datein) { char tmp[64]; while (datein[0] == ' ') datein++; // eat leading spaces - mir_strncpy(tmp, datein, 63); tmp[63] = 0; + strncpy(tmp, datein, 63); tmp[63] = 0; if (atoi(tmp)) { // Parseable integer on DayOfWeek field? Buggy mime date. day = tmp; } diff --git a/plugins/YAMN/src/mails/decode.cpp b/plugins/YAMN/src/mails/decode.cpp index 8b18a509f8..6ca2a0238b 100644 --- a/plugins/YAMN/src/mails/decode.cpp +++ b/plugins/YAMN/src/mails/decode.cpp @@ -495,7 +495,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode) finderend--;
}
char *oneWordEncoded = new char[finderend-finder+1];
- mir_strncpy(oneWordEncoded,finder,finderend-finder);
+ strncpy(oneWordEncoded,finder,finderend-finder);
oneWordEncoded[finderend-finder]=0;
switch(Encoding)
{
diff --git a/plugins/YAMN/src/mails/mails.cpp b/plugins/YAMN/src/mails/mails.cpp index 1212ec0e30..ad9083f5b9 100644 --- a/plugins/YAMN/src/mails/mails.cpp +++ b/plugins/YAMN/src/mails/mails.cpp @@ -438,7 +438,7 @@ void WINAPI TranslateHeaderFcn(char *stream,int len,struct CMimeItem **head) if (NULL==(Item->Next=new struct CMimeItem)) break; // Cant create new item?!
Item=Item->Next;
Item->Next=NULL;//just in case;
- Item->name=new char[5]; mir_strncpy(Item->name,"Body",5);
+ Item->name=new char[5]; strncpy(Item->name,"Body",5);
Item->value=new char [prev2-prev1];
mir_strncpy(Item->value,prev1,prev2-prev1-1);
}
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 8d09e8240f..a837cda3b7 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -78,7 +78,7 @@ static void GetProfileDirectory(TCHAR *szPath, int cbPath) _T("") }; SHFileOperation(&file_op); - mir_tstrncpy(szPath, ptszNewPath, cbPath); + _tcsncpy(szPath, ptszNewPath, cbPath); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 5e54392edd..f968d505a2 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -292,7 +292,7 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) POPUPDATAT pd = {0};
mir_tstrcpy(pd.lptzContactName, lParam == SM_WARNING ? _T("Warning") : _T("Notification"));
pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
- mir_tstrncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
+ _tcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0);
}
return 0;
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 68f39dea74..f98482dcdd 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -143,7 +143,7 @@ int MatchesFilterCS(const TCHAR *filter, const PopupHistoryData *popupItem) //ca __inline void ConvertCase(TCHAR *dest, const TCHAR *source, size_t size)
{
- mir_tstrncpy(dest, source, size);
+ _tcsncpy(dest, source, size);
_tcslwr(dest);
}
@@ -493,7 +493,7 @@ void CopyPopupDataToClipboard(HWND hList, int selection) HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(TCHAR));
clipboard = (TCHAR *) GlobalLock(hData);
- mir_tstrncpy(clipboard, buffer, len);
+ _tcsncpy(clipboard, buffer, len);
clipboard[len] = _T('\0');
GlobalUnlock(hData);
if (!SetClipboardData(textType, hData))
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 48de35a8f6..a87eafb9a6 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -205,7 +205,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) char *szBuf = szUtfMsg.str;
for (int i=0; i < iPartCount; i++, szBuf += cbPortion) {
char *szMsgPart = (char*)mir_alloc(cbPortion+1);
- mir_strncpy(szMsgPart, szBuf, cbPortion);
+ strncpy(szMsgPart, szBuf, cbPortion);
szMsgPart[cbPortion] = 0;
HANDLE hMsgProc = (HANDLE)CallContactService(hForwardTo, PSS_MESSAGE, 0, (LPARAM)szMsgPart);
@@ -241,10 +241,10 @@ extern "C" int __declspec(dllexport) Load() TCHAR *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
if (szForwardTemplate){
- mir_tstrncpy(tszForwardTemplate, szForwardTemplate, SIZEOF(tszForwardTemplate));
+ _tcsncpy(tszForwardTemplate, szForwardTemplate, SIZEOF(tszForwardTemplate));
mir_free(szForwardTemplate);
}
- else mir_tstrncpy(tszForwardTemplate, _T("%u: %m"), MAXTEMPLATESIZE-1);
+ else _tcsncpy(tszForwardTemplate, _T("%u: %m"), MAXTEMPLATESIZE-1);
iSplit = db_get_dw(NULL, "yaRelay", "Split", 0);
iSplitMaxSize = db_get_dw(NULL, "yaRelay", "SplitMaxSize", 100);
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index e802f31473..f13cc4ee2d 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -117,7 +117,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) {
char buffer[32] = {0};
mir_strcpy(buffer, "0x");
- mir_strncpy(buffer + 2, inData, HEX_SIZE);
+ strncpy(buffer + 2, inData, HEX_SIZE);
sscanf(buffer, "%x", &size);
outData = (unsigned char*)new char[size*2];
UINT i;
@@ -126,7 +126,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) buffer[4] = '\0'; //mark the end of the string
for (i = 0; i < size; i++)
{
- mir_strncpy(buffer + 2, &tmp[i * 2], 2);
+ strncpy(buffer + 2, &tmp[i * 2], 2);
sscanf(buffer, "%x", &outData[i]);
}
i = size;
@@ -143,7 +143,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName res = 0;
int tmp = (int)mir_strlen(dbv.pszVal);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_strncpy(szResult, dbv.pszVal, len);
+ strncpy(szResult, dbv.pszVal, len);
szResult[len] = '\0';
mir_free(dbv.pszVal);
}
@@ -153,7 +153,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName {
int tmp = (int)mir_strlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
- mir_strncpy(szResult, szError, len);
+ strncpy(szResult, szError, len);
szResult[len] = '\0';
}
else{
@@ -327,7 +327,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) szHandle = GetContactID(hContact, cProtocol);
tmp = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
- mir_tstrncpy(dispName, tmp, SIZEOF(dispName));
+ _tcsncpy(dispName, tmp, SIZEOF(dispName));
if ((szHandle) && ((mir_tstrcmpi(szHandle, szID) == 0) || (mir_tstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
found = 1;
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index cda62e18de..dae6100000 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -87,7 +87,7 @@ int AddDebugLogMessageA(const char* fmt, ...) #ifdef MODULENAME
mir_snprintf(szFinal, SIZEOF(szFinal), "%s: %s", MODULENAME, szText);
#else
- mir_strncpy(szFinal, szText, SIZEOF(szFinal));
+ strncpy(szFinal, szText, SIZEOF(szFinal));
#endif
res = WriteToDebugLogA(szFinal);
@@ -108,7 +108,7 @@ int AddDebugLogMessage(const TCHAR* fmt, ...) #ifdef MODULENAME
mir_sntprintf(tszFinal, SIZEOF(tszFinal), _T("%s: %s"), MODULENAME, tszText);
#else
- mir_tstrncpy(tszFinal, tszText, SIZEOF(tszFinal));
+ _tcsncpy(tszFinal, tszText, SIZEOF(tszFinal));
#endif
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 6d7209f0a3..af04e7156e 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -152,7 +152,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) logmsg("HookedNewEvent2");
TCHAR buf[512];
- mir_tstrncpy(buf, DEFAULT_MESSAGEFORMAT,SIZEOF(buf));
+ _tcsncpy(buf, DEFAULT_MESSAGEFORMAT,SIZEOF(buf));
DBVARIANT dbv;
if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) {
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index 25a6eb9012..01944ef024 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -413,7 +413,7 @@ INT_PTR CAimProto::GetAvatar(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
if (GetAvatarInfo(0, (LPARAM)&ai) == GAIR_SUCCESS)
{
- mir_tstrncpy(buf, ai.filename, size);
+ _tcsncpy(buf, ai.filename, size);
buf[size-1] = 0;
return 0;
}
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 3a87ed85af..3f9dfa0994 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -223,7 +223,7 @@ INT_PTR FacebookProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
- mir_tstrncpy(buf, ai.filename, size);
+ _tcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 8f4c54600b..16af0a823e 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -67,7 +67,7 @@ LPTSTR ExtractJid(LPCTSTR jidWithRes) size_t l = size_t(p - jidWithRes);
LPTSTR result = (LPTSTR)mir_alloc((l + 1) * sizeof(TCHAR));
- mir_tstrncpy(result, jidWithRes, l);
+ _tcsncpy(result, jidWithRes, l);
result[l] = 0;
return result;
}
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 6d4bfcb17d..2bf2907cf4 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -207,7 +207,7 @@ int gg_decodehosts(char *var, GGHOST *hosts, int max) // Insert new item
hosts[hp].hostname[127] = 0;
- mir_strncpy(hosts[hp].hostname, hostname, 127);
+ strncpy(hosts[hp].hostname, hostname, 127);
hosts[hp].port = portname ? atoi(portname) : 443;
hp ++;
diff --git a/protocols/Gadu-Gadu/src/dynstuff.cpp b/protocols/Gadu-Gadu/src/dynstuff.cpp index e84273f6a3..4d21ed7eb0 100644 --- a/protocols/Gadu-Gadu/src/dynstuff.cpp +++ b/protocols/Gadu-Gadu/src/dynstuff.cpp @@ -247,7 +247,7 @@ int string_append_n(string_t s, const char *str, int count) string_realloc(s, s->len + count);
s->str[s->len + count] = 0;
- mir_strncpy(s->str + s->len, str, count);
+ strncpy(s->str + s->len, str, count);
s->len += count;
@@ -480,7 +480,7 @@ char **array_make(const char *string, const char *sep, int max, int trim, int qu } else {
for (q = p, len = 0; *q && (last || !strchr(sep, *q)); q++, len++);
token = (char*)calloc(1, len + 1);
- mir_strncpy(token, p, len);
+ strncpy(token, p, len);
token[len] = 0;
p = q;
}
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index bfa4e99c50..3d23d0a9a5 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -269,7 +269,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc->tick = tick;
- mir_strncpy(filename, local_dcc->folder, sizeof(filename));
+ strncpy(filename, local_dcc->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -300,7 +300,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_strncpy(filename, local_dcc->folder, sizeof(filename));
+ strncpy(filename, local_dcc->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -499,7 +499,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc7->tick = tick;
- mir_strncpy(filename, local_dcc7->folder, sizeof(filename));
+ strncpy(filename, local_dcc7->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -530,7 +530,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc7->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_strncpy(filename, local_dcc7->folder, sizeof(filename));
+ strncpy(filename, local_dcc7->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -666,7 +666,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath) {
struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- mir_strncpy(fileName, path, sizeof(fileName));
+ strncpy(fileName, path, sizeof(fileName));
mir_strncat(fileName, (char*)dcc->file_info.filename, sizeof(fileName) - mir_strlen(fileName));
dcc->folder = _strdup((char *) path);
dcc->tick = 0;
@@ -708,7 +708,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath) struct gg_dcc7 *dcc7 = (struct gg_dcc7 *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
int iFtRemoveRes;
- mir_strncpy(fileName, path, sizeof(fileName));
+ strncpy(fileName, path, sizeof(fileName));
mir_strncat(fileName, (char*)dcc7->filename, sizeof(fileName) - mir_strlen(fileName));
dcc7->folder = _strdup((char *) path);
dcc7->tick = 0;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 7196ed4b3c..45fd51745f 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -436,7 +436,7 @@ void gg_debughandler(int level, const char *format, va_list ap) char *nl = strrchr(szFormat, '\n');
if (nl) *nl = 0;
- mir_strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
+ strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
char prefix[6];
mir_snprintf(prefix, SIZEOF(prefix), "%lu", GetCurrentThreadId());
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 56528ba82b..7fccf30251 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -226,10 +226,10 @@ TCHAR *gg_img_getfilter(TCHAR *szFilter, int nSize) szFilterMask = _T("*.bmp;*.gif;*.jpeg;*.jpg;*.png");
// Make up filter
- mir_tstrncpy(pFilter, szFilterName, nSize);
+ _tcsncpy(pFilter, szFilterName, nSize);
pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
- mir_tstrncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
+ _tcsncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
*pFilter = 0;
@@ -251,7 +251,7 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat) gg_img_getfilter(szFilter, SIZEOF(szFilter));
TCHAR szFileName[MAX_PATH];
- mir_tstrncpy(szFileName, dat->lpszFileName, SIZEOF(szFileName));
+ _tcsncpy(szFileName, dat->lpszFileName, SIZEOF(szFileName));
OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 42ee730f8e..2ca709ae01 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -119,7 +119,7 @@ char *strndup(char *str, int c) {
char *ret = (char*)malloc(c + 1);
ret[c] = 0;
- mir_strncpy(ret, str, c);
+ strncpy(ret, str, c);
return ret;
}
@@ -174,7 +174,7 @@ void GGPROTO::parsecontacts(char *contacts) if (n && n != p)
{
strPhone = (char*)malloc((n - p) + 5);
- mir_strncpy(strPhone, p, (n - p));
+ strncpy(strPhone, p, (n - p));
mir_strcpy((strPhone + (n - p)), " SMS"); // Add SMS postfix
}
p = (n + 1);
@@ -336,24 +336,24 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam) OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- mir_tstrncpy(filter, TranslateT("Text files"), SIZEOF(filter));
+ _tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
mir_tstrncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
mir_tstrncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
@@ -403,25 +403,25 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) OPENFILENAME ofn = {0};
TCHAR filter[512], *pfilter;
- mir_tstrncpy(str, TranslateT("contacts"), SIZEOF(str));
+ _tcsncpy(str, TranslateT("contacts"), SIZEOF(str));
mir_tstrncat(str, _T(".txt"), SIZEOF(str) - mir_tstrlen(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- mir_tstrncpy(filter, TranslateT("Text files"), SIZEOF(filter));
+ _tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
mir_tstrncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
mir_tstrncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 09b79b9b44..d0f442d872 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -42,7 +42,7 @@ char *gg_status2db(int status, const char *suffix) case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
default: return NULL;
}
- mir_strncpy(str, prefix, sizeof(str));
+ strncpy(str, prefix, sizeof(str));
mir_strncat(str, suffix, sizeof(str) - mir_strlen(str));
return str;
}
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp index 85df02f089..2fcf36d31d 100644 --- a/protocols/Gadu-Gadu/src/token.cpp +++ b/protocols/Gadu-Gadu/src/token.cpp @@ -132,7 +132,7 @@ int GGPROTO::gettoken(GGTOKEN *token) }
// Return token id
- mir_strncpy(dat.id, t->tokenid, sizeof(dat.id));
+ strncpy(dat.id, t->tokenid, sizeof(dat.id));
dat.width = t->width;
dat.height = t->height;
@@ -154,8 +154,8 @@ int GGPROTO::gettoken(GGTOKEN *token) return FALSE;
// Fillup patterns
- mir_strncpy(token->id, dat.id, sizeof(token->id));
- mir_strncpy(token->val, dat.val, sizeof(token->val));
+ strncpy(token->id, dat.id, sizeof(token->id));
+ strncpy(token->val, dat.val, sizeof(token->val));
return TRUE;
}
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index 1dd223b08a..a5fcae5ee3 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -126,7 +126,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) if (!gg->getString(GG_KEY_EMAIL, &dbv_email))
{
- mir_strncpy(email, dbv_email.pszVal, sizeof(email));
+ strncpy(email, dbv_email.pszVal, sizeof(email));
db_free(&dbv_email);
}
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 48bc68d16e..d4c8379d75 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -47,7 +47,7 @@ static INT_PTR icqGetCaps(WPARAM wParam, LPARAM lParam) static INT_PTR icqGetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, Translate(protoName), wParam);
+ strncpy((char*)lParam, Translate(protoName), wParam);
return 0;
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 29212e110d..24f51da361 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1218,7 +1218,7 @@ CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg if (mask == NULL)
szOldMask[0] = 0;
else
- mir_tstrncpy(szOldMask, mask, SIZEOF(szOldMask));
+ _tcsncpy(szOldMask, mask, SIZEOF(szOldMask));
m_Ok.OnClick = Callback(this, &CAddIgnoreDlg::OnOk);
}
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 89df241c17..ff7c0d5f1f 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -391,7 +391,7 @@ INT_PTR CIcqProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) TCHAR *tszFile = GetOwnAvatarFileName();
if (tszFile && !_taccess(tszFile, 0)) {
- mir_tstrncpy((TCHAR*)wParam, tszFile, (int)lParam);
+ _tcsncpy((TCHAR*)wParam, tszFile, (int)lParam);
SAFE_FREE(&tszFile);
return 0;
}
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index a94f366290..3a5974df1a 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -612,7 +612,7 @@ char* __fastcall null_strcpy(char *dest, const char *src, size_t maxlen) return NULL;
if (src && src[0]) {
- mir_strncpy(dest, src, maxlen);
+ strncpy(dest, src, maxlen);
dest[maxlen] = '\0';
}
else
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 6aeab1a831..79335a9182 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -602,7 +602,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) void CJabberProto::MenuInit()
{
char text[200];
- mir_strncpy(text, m_szModuleName, sizeof(text)-1);
+ strncpy(text, m_szModuleName, sizeof(text)-1);
char* tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -825,7 +825,7 @@ void CJabberProto::GlobalMenuInit() // Hotkeys
char text[200];
- mir_strncpy(text, m_szModuleName, sizeof(text) - 1);
+ strncpy(text, m_szModuleName, sizeof(text) - 1);
char* tDest = text + mir_strlen(text);
HOTKEYDESC hkd = { sizeof(hkd) };
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 483f1f488f..d2f84ff04f 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -669,7 +669,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & cle.ptszTooltip = szStatusText;
if (getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)) {
- mir_strncpy(szServiceFunction, m_szModuleName, MAX_PATH);
+ strncpy(szServiceFunction, m_szModuleName, MAX_PATH);
pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
memcpy(pszServiceFunctionName, MRA_GOTO_INBOX, sizeof(MRA_GOTO_INBOX));
cle.pszService = szServiceFunction;
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index f4c6136ca4..6f349e9d0d 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -278,7 +278,7 @@ int CMraProto::MraRebuildContactMenu(WPARAM hContact, LPARAM) int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM)
{
CHAR szServiceFunction[MAX_PATH * 2], *pszServiceFunctionName, szValueName[MAX_PATH];
- mir_strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
+ strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
TCHAR szItem[MAX_PATH + 64];
@@ -326,7 +326,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI return NULL;
char szServiceFunction[MAX_PATH];
- mir_strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
+ strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
char *pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 8f3e6e0ba6..4e9b439eb7 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -47,14 +47,14 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p {
char *szNet, *szEmail;
- mir_tstrncpy(info->mChatID, _A2T(pszID), SIZEOF(info->mChatID));
+ _tcsncpy(info->mChatID, _A2T(pszID), SIZEOF(info->mChatID));
parseWLID(NEWSTR_ALLOCA(pszID), &szNet, &szEmail, NULL);
info->netId = atoi(szNet);
- mir_strncpy(info->szEmail, szEmail, sizeof(info->szEmail));
+ strncpy(info->szEmail, szEmail, sizeof(info->szEmail));
TCHAR szName[512];
InterlockedIncrement(&m_chatID);
- if (*pszTopic) mir_tstrncpy(szName, _A2T(pszTopic), SIZEOF(szName));
+ if (*pszTopic) _tcsncpy(szName, _A2T(pszTopic), SIZEOF(szName));
else mir_sntprintf(szName, SIZEOF(szName), _T("%s %s%d"),
m_tszUserName, TranslateT("Chat #"), m_chatID);
@@ -123,7 +123,7 @@ void CMsnProto::MSN_ChatStart(ezxml_t xmli) if (!gcu) {
gcu = new GCUserItem;
info->mJoinedContacts.insert(gcu);
- mir_strncpy(gcu->WLID, mri, sizeof(gcu->WLID));
+ strncpy(gcu->WLID, mri, sizeof(gcu->WLID));
}
mir_tstrcpy(gcu->role, _A2T(role));
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp index bf45995a0f..78e9c66584 100644 --- a/protocols/MSN/src/msn_libstr.cpp +++ b/protocols/MSN/src/msn_libstr.cpp @@ -411,6 +411,6 @@ time_t MsnTSToUnixtime(const char *pszTS) char szTS[16];
if (!*pszTS) return time(NULL);
- mir_strncpy(szTS, pszTS, 10);
+ strncpy(szTS, pszTS, 10);
return (time_t)atoi(szTS);
}
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 6a50f7dcd4..fbaa187a5c 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -100,7 +100,7 @@ bool CMsnProto::p2p_createListener(filetransfer* ft, directconnection *dc, MimeH newThread->mCaller = 3;
newThread->mIncomingBoundPort = sb;
newThread->mIncomingPort = nlb.wPort;
- mir_strncpy(newThread->mCookie, dc->callId, sizeof(newThread->mCookie));
+ strncpy(newThread->mCookie, dc->callId, sizeof(newThread->mCookie));
newThread->mInitialContactWLID = mir_strdup(ft->p2p_dest);
newThread->startThread(&CMsnProto::p2p_filePassiveThread, this);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index b1a15f850a..f9a2ee775f 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -363,15 +363,15 @@ void CSametimeProto::LoadOptions() DBVARIANT dbv;
if (!db_get_utf(0, m_szModuleName, "ServerName", &dbv)) {
- mir_strncpy(options.server_name, dbv.pszVal, LSTRINGLEN);
+ strncpy(options.server_name, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
if (!db_get_utf(0, m_szModuleName, "stid", &dbv)) {
- mir_strncpy(options.id, dbv.pszVal, LSTRINGLEN);
+ strncpy(options.id, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
if (!db_get_utf(0, m_szModuleName, "Password", &dbv)) {
- mir_strncpy(options.pword, dbv.pszVal, LSTRINGLEN);
+ strncpy(options.pword, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 627b9a7d56..708be8481f 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -44,7 +44,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO */
INT_PTR CSametimeProto::GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, m_szModuleName, wParam);
+ strncpy((char*)lParam, m_szModuleName, wParam);
return 0;
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index aeb7b69156..debe054ec3 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -673,10 +673,10 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code if (advanced == TRUE) {
// send column names
mcsr.psr.cbSize = 0;
- mir_tstrncpy(mcsr.pszFields[0], TranslateT("ID"), 512);
- mir_tstrncpy(mcsr.pszFields[1], TranslateT("Name"), 512);
- mir_tstrncpy(mcsr.pszFields[2], TranslateT("Description"), 512);
- mir_tstrncpy(mcsr.pszFields[3], TranslateT("Group?"), 512);
+ _tcsncpy(mcsr.pszFields[0], TranslateT("ID"), 512);
+ _tcsncpy(mcsr.pszFields[1], TranslateT("Name"), 512);
+ _tcsncpy(mcsr.pszFields[2], TranslateT("Description"), 512);
+ _tcsncpy(mcsr.pszFields[3], TranslateT("Group?"), 512);
proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr);
}
@@ -687,11 +687,11 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code for (; ri; ri = ri->next) {
mri = ((mwResolveResult *)ri->data)->matches;
for (; mri; mri = mri->next) {
- mir_strncpy(mcsr.psr.stid, ((mwResolveMatch *)mri->data)->id, 256);
+ strncpy(mcsr.psr.stid, ((mwResolveMatch *)mri->data)->id, 256);
mcsr.psr.stid[255] = 0;
MultiByteToWideChar(CP_UTF8, 0, mcsr.psr.stid, -1, mcsr.pszFields[0], 512);
- mir_strncpy(mcsr.psr.name, ((mwResolveMatch *)mri->data)->name, 256);
+ strncpy(mcsr.psr.name, ((mwResolveMatch *)mri->data)->name, 256);
mcsr.psr.name[255] = 0;
MultiByteToWideChar(CP_UTF8, 0, mcsr.psr.name, -1, mcsr.pszFields[1], 512);
@@ -702,7 +702,7 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code mcsr.psr.group = (((mwResolveMatch *)mri->data)->type == mwResolveMatch_GROUP);
//MultiByteToWideChar(CP_UTF8, 0, mcsr.psr.name, -1, mcsr.pszFields[1], 512);
- mir_tstrncpy(mcsr.pszFields[3], mcsr.psr.group ? TranslateT("True") : TranslateT("False"), 512);
+ _tcsncpy(mcsr.pszFields[3], mcsr.psr.group ? TranslateT("True") : TranslateT("False"), 512);
if (advanced == TRUE)
proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr);
diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp index 5a8ff3df76..313af9a315 100644 --- a/protocols/SkypeClassic/src/filexfer.cpp +++ b/protocols/SkypeClassic/src/filexfer.cpp @@ -366,7 +366,7 @@ BOOL FXHandleMessage(const char *pszMsg) if (!pTok)
return FALSE;
- mir_strncpy(args.szNum, pszMsg, pTok - pszMsg);
+ strncpy(args.szNum, pszMsg, pTok - pszMsg);
pszMsg = pTok + 1;
if (!(pTok = strchr(pszMsg, ' '))) return FALSE;
pTok++;
@@ -374,7 +374,7 @@ BOOL FXHandleMessage(const char *pszMsg) return FALSE;
ft_args *pargs = (ft_args*)malloc(sizeof(args));
if (!pargs) return TRUE;
- mir_strncpy(args.szArg, pTok, sizeof(args.szArg));
+ strncpy(args.szArg, pTok, sizeof(args.szArg));
memcpy(pargs, &args, sizeof(args));
pthread_create((pThreadFunc)FXHandleMessageThread, pargs);
return TRUE;
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 14a4363533..147b467ecc 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -1387,7 +1387,7 @@ void MessageListProcessingThread(char *str) { // Frst we need to sort the message timestamps
for ((token = strtok_r(str+1, ", ", &nextoken)); token; token = strtok_r(NULL, ", ", &nextoken)) {
if (args = (fetchmsg_arg*)calloc(1, sizeof(fetchmsg_arg) + sizeof(DWORD))) {
- mir_strncpy(args->msgnum, token, sizeof(args->msgnum)-1);
+ strncpy(args->msgnum, token, sizeof(args->msgnum)-1);
args->getstatus = TRUE;
args->bIsRead = *str;
args->bDontMarkSeen = *str;
@@ -2163,7 +2163,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) // If new message is available, fetch it
ptr[0] = 0;
if (!(args = (fetchmsg_arg *)calloc(1, sizeof(*args)))) break;
- mir_strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)-1);
+ strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)-1);
args->getstatus = FALSE;
//args->bIsRead = strncmp(ptr+8, "READ", 4) == 0;
pthread_create((pThreadFunc)FetchMessageThreadSync, args);
@@ -2467,7 +2467,7 @@ void RetrieveUserAvatar(void *param) // Got it
MoveFileExA(pszTempFile, AvatarFile, MOVEFILE_REPLACE_EXISTING);
AI.format = PA_FORMAT_JPEG;
- mir_strncpy(AI.filename, AvatarFile,SIZEOF(AI.filename)-1);
+ strncpy(AI.filename, AvatarFile,SIZEOF(AI.filename)-1);
ack.hProcess = (HANDLE)&AI;
}
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index e86658e69f..ad6bc71967 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -518,7 +518,7 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) // isn't using the ID anymore, so we have to save the ID as new identifier for message recognition
pCurMsg+=iLenWhat;
if ((pMsg = strchr (pCurMsg, ' ')) && (pMsg=strchr (pMsg+1, ' ')))
- mir_strncpy (msgid, pCurMsg, pMsg-pCurMsg);
+ strncpy (msgid, pCurMsg, pMsg-pCurMsg);
else if (strncmp (pCurMsg, "ERROR", 5) == 0) bIsError = TRUE;
}
@@ -1171,7 +1171,7 @@ INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) { // Backup old file
if (hasOldAvatar)
{
- mir_strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4);
+ strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4);
OldAvatarFile[sizeof(OldAvatarFile)-5] = '\0';
mir_strcat(OldAvatarFile, "_old");
DeleteFileA(OldAvatarFile);
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index fb35c5f483..358a95e153 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -611,12 +611,12 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L db_set_b (NULL, SKYPE_PROTONAME, "secondary", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SECONDARY)));
GetDlgItemTextA(hwndDlg,IDC_COMMANDLINE,text,SIZEOF(text));
- mir_strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
+ strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath);
db_set_s(NULL, SKYPE_PROTONAME, "CommandLine", szRelativePath);
GetDlgItemTextA(hwndDlg,IDC_DATAPATH,text,SIZEOF(text));
- mir_strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
+ strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath);
db_set_s(NULL, SKYPE_PROTONAME, "datapath", szRelativePath);
diff --git a/protocols/SkypeClassic/src/skypeprofile.cpp b/protocols/SkypeClassic/src/skypeprofile.cpp index b796a96667..045a5b7d78 100644 --- a/protocols/SkypeClassic/src/skypeprofile.cpp +++ b/protocols/SkypeClassic/src/skypeprofile.cpp @@ -105,7 +105,7 @@ static void LoadSaveSkype(SkypeProfile *pstProf, BOOL bSet) if (astSettings[i].cType == sizeof(char)) {
char *pBuf;
if (utf8_decode (ptr, &pBuf) != -1) {
- mir_strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize);
+ strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize);
free (pBuf);
}
} else {
diff --git a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c index 0802788e10..200b79632a 100644 --- a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c +++ b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c @@ -520,7 +520,7 @@ int main(int argc, char *argv[]) { }
for (i=0;i<argc;i++) {
if (!mir_strcmpi(argv[i], "-i") && argc>i+1)
- mir_strncpy(BindIP, argv[i+1], sizeof(BindIP));
+ strncpy(BindIP, argv[i+1], sizeof(BindIP));
if (!mir_strcmpi(argv[i], "-p") && argc>i+1)
if (!(BindPort=atoi(argv[i+1]))) {
OUTPUT("ERROR: Cannot convert port to int. bye..");
diff --git a/protocols/SkypeClassic/src/skypesvc.cpp b/protocols/SkypeClassic/src/skypesvc.cpp index e893721e42..fae8b8cd3b 100644 --- a/protocols/SkypeClassic/src/skypesvc.cpp +++ b/protocols/SkypeClassic/src/skypesvc.cpp @@ -147,7 +147,7 @@ INT_PTR SkypeGetName(WPARAM wParam, LPARAM lParam) {
if (lParam)
{
- mir_strncpy((char *)lParam, SKYPE_PROTONAME, wParam);
+ strncpy((char *)lParam, SKYPE_PROTONAME, wParam);
return 0; // Success
}
return 1; // Failure
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 91f992f6a9..9effeb2554 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -99,7 +99,7 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) TCHAR tszFileName[MAX_PATH];
GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
- mir_tstrncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
+ _tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
if (::_taccess(AI->filename, 0) == 0 && !getBool(AI->hContact, "NeedNewAvatar", 0))
return GAIR_SUCCESS;
@@ -118,7 +118,7 @@ INT_PTR CSkypeProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) {
TCHAR path[MAX_PATH];
GetAvatarFileName(NULL, path, SIZEOF(path));
- mir_tstrncpy((TCHAR*)wParam, path, (int)lParam);
+ _tcsncpy((TCHAR*)wParam, path, (int)lParam);
return 0;
}
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index a8f4a811f9..ec2694b878 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -148,7 +148,7 @@ INT_PTR CSteamProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
- mir_tstrncpy(buf, ai.filename, size);
+ _tcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index e82ddbc75f..e87fcac01d 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -214,7 +214,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam) if (end == NULL) {
end = resp->headers[i].szValue + mir_strlen(resp->headers[i].szValue);
}
- mir_strncpy(cookie, start, (end - start));
+ strncpy(cookie, start, (end - start));
break;
}
}
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index fb58de29c0..71ad60185f 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -578,7 +578,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) if (numFiles == 1) {
if ((p=TlenXmlGetAttrValue(node, "n")) != NULL) {
p = TlenTextDecode(p);
- mir_strncpy(szFilename, p, sizeof(szFilename)-1);
+ strncpy(szFilename, p, sizeof(szFilename)-1);
mir_free(p);
} else {
mir_strcpy(szFilename, Translate("1 File"));
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp index a710bc6cd2..6442ecf019 100644 --- a/protocols/Tlen/src/tlen_opt.cpp +++ b/protocols/Tlen/src/tlen_opt.cpp @@ -602,8 +602,8 @@ static void MailPopupPreview(DWORD colorBack, DWORD colorText, TCHAR *title, TCH HICON hIcon = GetIcolibIcon(IDI_MAIL); ppd.lchIcon = CopyIcon(hIcon); ReleaseIcolibIcon(hIcon); - mir_tstrncpy(ppd.lptzContactName, title, MAX_CONTACTNAME-1); - mir_tstrncpy(ppd.lptzText, emailInfo,MAX_SECONDLINE-1); + _tcsncpy(ppd.lptzContactName, title, MAX_CONTACTNAME-1); + _tcsncpy(ppd.lptzText, emailInfo,MAX_SECONDLINE-1); ppd.colorBack = colorBack; ppd.colorText = colorText; ppd.iSeconds = delay; diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp index 51499497f3..cb72d33849 100644 --- a/protocols/Tlen/src/tlen_p2p_old.cpp +++ b/protocols/Tlen/src/tlen_p2p_old.cpp @@ -334,7 +334,7 @@ static HANDLE TlenP2PBindSocks4(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft) return NULL;
}
in.S_un.S_addr = *(PDWORD)(buf+4);
- mir_strncpy(sb->szHost, inet_ntoa(in), sizeof(sb->szHost)-1);
+ strncpy(sb->szHost, inet_ntoa(in), sizeof(sb->szHost)-1);
sb->wPort = htons(*(PWORD)(buf+2));
ft->s = s;
forkthread((void (__cdecl *)(void*))TlenFileBindSocks4Thread, 0, ft);
@@ -463,11 +463,11 @@ HANDLE TlenP2PListen(TLEN_FILE_TRANSFER *ft) if (db_get_b(NULL, proto->m_szModuleName, "FileProxyAuth", FALSE)) {
sb.useAuth = TRUE;
if (!db_get_s(NULL, proto->m_szModuleName, "FileProxyUsername", &dbv)) {
- mir_strncpy(sb.szUser, dbv.pszVal, sizeof(sb.szUser)-1);
+ strncpy(sb.szUser, dbv.pszVal, sizeof(sb.szUser)-1);
db_free(&dbv);
}
if (!db_get_s(NULL, proto->m_szModuleName, "FileProxyPassword", &dbv)) {
- mir_strncpy(sb.szPassword, dbv.pszVal, sizeof(sb.szPassword)-1);
+ strncpy(sb.szPassword, dbv.pszVal, sizeof(sb.szPassword)-1);
db_free(&dbv);
}
}
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 487302c7fd..705b4ca150 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -55,7 +55,7 @@ DWORD_PTR TlenProtocol::GetCaps(int type, MCONTACT hContact) INT_PTR TlenProtocol::GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, m_szModuleName, wParam);
+ strncpy((char*)lParam, m_szModuleName, wParam);
return 0;
}
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index d3eb3ddab4..f614b0a323 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -130,7 +130,7 @@ void __cdecl TlenServerThread(ThreadData *info) DBVARIANT dbv;
if (!db_get(NULL, info->proto->m_szModuleName, "LoginName", &dbv)) {
- mir_strncpy(info->username, dbv.pszVal, sizeof(info->username));
+ strncpy(info->username, dbv.pszVal, sizeof(info->username));
info->username[sizeof(info->username)-1] = '\0';
_strlwr(info->username);
db_set_s(NULL, info->proto->m_szModuleName, "LoginName", info->username);
@@ -143,7 +143,7 @@ void __cdecl TlenServerThread(ThreadData *info) if (loginErr == 0) {
if (!db_get(NULL, info->proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_strncpy(info->server, dbv.pszVal, sizeof(info->server));
+ strncpy(info->server, dbv.pszVal, sizeof(info->server));
info->server[sizeof(info->server)-1] = '\0';
_strlwr(info->server);
db_set_s(NULL, info->proto->m_szModuleName, "LoginServer", info->server);
@@ -168,7 +168,7 @@ void __cdecl TlenServerThread(ThreadData *info) CloseHandle(hEventPasswdDlg);
if (onlinePassword[0] != (char) -1) {
- mir_strncpy(info->password, onlinePassword, sizeof(info->password));
+ strncpy(info->password, onlinePassword, sizeof(info->password));
info->password[sizeof(info->password)-1] = '\0';
}
else {
@@ -178,7 +178,7 @@ void __cdecl TlenServerThread(ThreadData *info) }
else {
if (!db_get(NULL, info->proto->m_szModuleName, "Password", &dbv)) {
- mir_strncpy(info->password, dbv.pszVal, sizeof(info->password));
+ strncpy(info->password, dbv.pszVal, sizeof(info->password));
info->password[sizeof(info->password)-1] = '\0';
db_free(&dbv);
}
@@ -211,7 +211,7 @@ void __cdecl TlenServerThread(ThreadData *info) db_set_s(NULL, info->proto->m_szModuleName, "jid", jidStr);
if (!db_get(NULL, info->proto->m_szModuleName, "ManualHost", &dbv)) {
- mir_strncpy(info->manualHost, dbv.pszVal, sizeof(info->manualHost));
+ strncpy(info->manualHost, dbv.pszVal, sizeof(info->manualHost));
info->manualHost[sizeof(info->manualHost)-1] = '\0';
db_free(&dbv);
}
@@ -227,7 +227,7 @@ void __cdecl TlenServerThread(ThreadData *info) if (!db_get(NULL, info->proto->m_szModuleName, "AvatarHash", &dbv)) {
- mir_strncpy(info->proto->threadData->avatarHash, dbv.pszVal, sizeof(info->proto->threadData->avatarHash)-1);
+ strncpy(info->proto->threadData->avatarHash, dbv.pszVal, sizeof(info->proto->threadData->avatarHash)-1);
db_free(&dbv);
}
info->avatarFormat = db_get_dw(NULL, info->proto->m_szModuleName, "AvatarFormat", PA_FORMAT_UNKNOWN);
@@ -587,7 +587,7 @@ static void TlenProcessAvatar(XmlNode* node, ThreadData *info) XmlNode *aNode = TlenXmlGetChild(node, "a");
if (tokenNode != NULL) {
char *token = tokenNode->text;
- mir_strncpy(info->avatarToken, token, sizeof(info->avatarToken)-1);
+ strncpy(info->avatarToken, token, sizeof(info->avatarToken)-1);
}
if (aNode != NULL) {
if (TlenProcessAvatarNode(info->proto, node, NULL)) {
@@ -1063,8 +1063,8 @@ static void TlenMailPopup(TlenProtocol *proto, char *title, char *emailInfo) POPUPDATAT ppd = { 0 };
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIL));
- mir_tstrncpy(ppd.lptzContactName, _A2T(title), MAX_CONTACTNAME -1);
- mir_tstrncpy(ppd.lptzText, _A2T(emailInfo), MAX_SECONDLINE - 1);
+ _tcsncpy(ppd.lptzContactName, _A2T(title), MAX_CONTACTNAME -1);
+ _tcsncpy(ppd.lptzText, _A2T(emailInfo), MAX_SECONDLINE - 1);
ppd.colorBack = db_get_dw(NULL, proto->m_szModuleName, "MailPopupBack", 0);
ppd.colorText = db_get_dw(NULL, proto->m_szModuleName, "MailPopupText", 0);
BYTE delayMode = db_get_b(NULL, proto->m_szModuleName, "MailPopupDelayMode", 0);
diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp index 61bde3433d..f315a3e177 100644 --- a/protocols/Tlen/src/tlen_util.cpp +++ b/protocols/Tlen/src/tlen_util.cpp @@ -85,7 +85,7 @@ char *TlenResourceFromJID(const char *jid2) if (p != NULL && p[1] != '\0') {
p++;
if ((nick=(char *) mir_alloc(1+mir_strlen(jid)-(p-jid))) != NULL) {
- mir_strncpy(nick, p, mir_strlen(jid)-(p-jid));
+ strncpy(nick, p, mir_strlen(jid)-(p-jid));
nick[mir_strlen(jid)-(p-jid)] = '\0';
}
}
@@ -107,7 +107,7 @@ char *TlenNickFromJID(const char *jid2) p = strchr(jid, '/');
if (p != NULL) {
if ((nick=(char *) mir_alloc((p-jid)+1)) != NULL) {
- mir_strncpy(nick, jid, p-jid);
+ strncpy(nick, jid, p-jid);
nick[p-jid] = '\0';
}
}
@@ -128,7 +128,7 @@ char *TlenLoginFromJID(const char *jid2) p = strchr(jid, '/');
if (p != NULL) {
if ((nick=(char *) mir_alloc((p-jid)+1)) != NULL) {
- mir_strncpy(nick, jid, p-jid);
+ strncpy(nick, jid, p-jid);
nick[p-jid] = '\0';
}
}
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index 1c4149c8ae..70bf723c23 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -1016,7 +1016,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) db_free(&dbv);
}
else {
- mir_strncpy(jid, from, SIZEOF(jid) - 1);
+ strncpy(jid, from, SIZEOF(jid) - 1);
}
ignore = !IsAuthorized(proto, jid);
ask = true;
@@ -1029,7 +1029,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) db_free(&dbv);
}
else {
- mir_strncpy(jid, from, SIZEOF(jid) - 1);
+ strncpy(jid, from, SIZEOF(jid) - 1);
}
ask = !IsAuthorized(proto, jid);
ignore = false;
diff --git a/protocols/Tlen/src/tlen_xml.cpp b/protocols/Tlen/src/tlen_xml.cpp index 5939c65d58..408df2ab3a 100644 --- a/protocols/Tlen/src/tlen_xml.cpp +++ b/protocols/Tlen/src/tlen_xml.cpp @@ -126,18 +126,18 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen) } else { if (*(p+1) == '/') { // closing tag - mir_strncpy(tag, p+2, r-(p+2)); + strncpy(tag, p+2, r-(p+2)); tag[r-(p+2)] = '\0'; elemType = ELEM_CLOSE; } else { if (*(r-1) == '/') { // single open/close tag - mir_strncpy(tag, p+1, r-(p+1)-1); + strncpy(tag, p+1, r-(p+1)-1); tag[r-(p+1)-1] = '\0'; elemType = ELEM_OPENCLOSE; } else { - mir_strncpy(tag, p+1, r-(p+1)); + strncpy(tag, p+1, r-(p+1)); tag[r-(p+1)] = '\0'; elemType = ELEM_OPEN; } @@ -147,7 +147,7 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen) // TlenLog("ATTR_MAX_LEN too small, ignore current tag"); } else { - mir_strncpy(attr, r, q-r); + strncpy(attr, r, q-r); if ((q-r)>0 && attr[q-r-1] == '/') { attr[q-r-1] = '\0'; elemType = ELEM_OPENCLOSE; @@ -171,7 +171,7 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen) for (q=p+1; q<eob && *q != '<'; q++); if (q < eob) { // found starting bracket of the next element str = (char *) mir_alloc(q-p+1); - mir_strncpy(str, p, q-p); + strncpy(str, p, q-p); str[q-p] = '\0'; TlenXmlProcessElem(xmlState, ELEM_TEXT, str, NULL); mir_free(str); @@ -220,7 +220,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text) if (*p == '\0') { a->name = (char *) mir_alloc(klen+1); - mir_strncpy(a->name, kstart, klen); + strncpy(a->name, kstart, klen); a->name[klen] = '\0'; a->value = mir_strdup(""); break; @@ -228,7 +228,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text) if (*p != '=') { a->name = (char *) mir_alloc(klen+1); - mir_strncpy(a->name, kstart, klen); + strncpy(a->name, kstart, klen); a->name[klen] = '\0'; a->value = mir_strdup(""); continue; @@ -242,7 +242,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text) if (*p == '\0') { a->name = (char *) mir_alloc(klen+1); - mir_strncpy(a->name, kstart, klen); + strncpy(a->name, kstart, klen); a->name[klen] = '\0'; a->value = mir_strdup(""); break; @@ -263,10 +263,10 @@ static void TlenXmlParseAttr(XmlNode *node, char *text) } a->name = (char *) mir_alloc(klen+1); - mir_strncpy(a->name, kstart, klen); + strncpy(a->name, kstart, klen); a->name[klen] = '\0'; a->value = (char *) mir_alloc(vlen+1); - mir_strncpy(a->value, vstart, vlen); + strncpy(a->value, vstart, vlen); a->value[vlen] = '\0'; } } diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index 0b3d04b732..e1460b3d53 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -201,7 +201,7 @@ HANDLE CToxProto::OnSendFile(MCONTACT hContact, const PROTOCHAR*, PROTOCHAR **pp TCHAR *fileName = _tcsrchr(ppszFiles[0], '\\') + 1;
size_t fileDirLength = fileName - ppszFiles[0];
TCHAR *fileDir = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileDirLength + 1));
- mir_tstrncpy(fileDir, ppszFiles[0], fileDirLength);
+ _tcsncpy(fileDir, ppszFiles[0], fileDirLength);
fileDir[fileDirLength] = '\0';
_fseeki64(hFile, 0, SEEK_END);
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 79d0e354ff..f793b09e0a 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -412,7 +412,7 @@ void TwitterProto::UpdateAvatarWorker(void *p) return; // lets just ignore unknown formats... if not it crashes miranda. should probably speak to borkra about this.
}
- mir_tstrncpy(ai.filename, filename.c_str(), MAX_PATH); // puts the local file name in the avatar struct, to a max of 260 chars (as of now)
+ _tcsncpy(ai.filename, filename.c_str(), MAX_PATH); // puts the local file name in the avatar struct, to a max of 260 chars (as of now)
debugLogA("***** Updating avatar: %s", data->url.c_str());
mir_cslock lck(avatar_lock_);
@@ -536,7 +536,7 @@ void TwitterProto::ShowContactPopup(MCONTACT hContact, const std::string &text, DBVARIANT dbv;
if (!db_get_ts(hContact, "CList", "MyHandle", &dbv) || !db_get_ts(hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) {
- mir_tstrncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
+ _tcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index 2dc2e9e6be..a0232d5da2 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -331,8 +331,8 @@ namespace popup_options // Pick a random quote
int q = rand() % SIZEOF(quotes);
- mir_tstrncpy(popup.lptzContactName, quotes[q].name, MAX_CONTACTNAME);
- mir_tstrncpy(popup.lptzText, quotes[q].text, MAX_SECONDLINE);
+ _tcsncpy(popup.lptzContactName, quotes[q].name, MAX_CONTACTNAME);
+ _tcsncpy(popup.lptzText, quotes[q].text, MAX_SECONDLINE);
popup.lchContact = hContact;
popup.iSeconds = get_timeout(hwndDlg);
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index 09d64881be..85740be99c 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -81,7 +81,7 @@ INT_PTR CVkProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) TCHAR tszFileName[MAX_PATH];
GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
- mir_tstrncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
+ _tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
AI->format = ProtoGetAvatarFormat(AI->filename);
@@ -117,7 +117,7 @@ INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) TCHAR* buf = (TCHAR*)wParam;
int size = (int)lParam;
- mir_tstrncpy(buf, AI.filename, size);
+ _tcsncpy(buf, AI.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/Xfire/src/client.cpp b/protocols/Xfire/src/client.cpp index 4e0e7d1321..024cfc16d9 100644 --- a/protocols/Xfire/src/client.cpp +++ b/protocols/Xfire/src/client.cpp @@ -92,7 +92,7 @@ using namespace std; struct sockaddr_in sa;
int iLen = sizeof(sa);
getsockname(socket->m_sock, (SOCKADDR*)&sa, &iLen);
- mir_strncpy(this->localaddr,inet_ntoa(sa.sin_addr), sizeof(this->localaddr)-1);
+ strncpy(this->localaddr,inet_ntoa(sa.sin_addr), sizeof(this->localaddr)-1);
this->llocaladdr=inet_addr(this->localaddr);
packetReader->setSocket(socket);
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index c6509ee017..0978600aaf 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -2833,7 +2833,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc GameServerQuery_query gsqq = { 0 };
gsqq.port = gameob->port;
gsqq.xfiregameid = entry->game;
- mir_strncpy(gsqq.ip, temp, SIZEOF(gsqq.ip)-1);
+ strncpy(gsqq.ip, temp, SIZEOF(gsqq.ip)-1);
CallService("GameServerQuery/Query", (WPARAM)entry, (LPARAM)&gsqq);
}
}
@@ -3395,7 +3395,7 @@ INT_PTR GetAvatarInfo(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv;
if (!db_get(pai->hContact, "ContactPhoto", "File", &dbv))
{
- mir_strncpy(pai->filename, dbv.pszVal, sizeof(pai->filename)-1);
+ strncpy(pai->filename, dbv.pszVal, sizeof(pai->filename)-1);
db_free(&dbv);
}
else
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index 81bd3e9427..01fb52f082 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -67,7 +67,7 @@ BOOL CheckPath(char*ppath, char*pathwildcard = NULL) {
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_strncpy(temp, ppath,XFIRE_MAX_STATIC_STRING_LEN-1);
+ strncpy(temp, ppath,XFIRE_MAX_STATIC_STRING_LEN-1);
*(temp + mir_strlen(temp) - 1) = 0;
mir_strncat(temp, wfd.cFileName, SIZEOF(temp) - mir_strlen(temp));
mir_strncat(temp, "\\", SIZEOF(temp) - mir_strlen(temp));
diff --git a/protocols/Xfire/src/services.cpp b/protocols/Xfire/src/services.cpp index 2955dc85fc..380308cc14 100644 --- a/protocols/Xfire/src/services.cpp +++ b/protocols/Xfire/src/services.cpp @@ -58,7 +58,7 @@ INT_PTR GetMyAvatar(WPARAM wparam, LPARAM lparam) { if (!db_get(NULL, protocolname, "MyAvatarFile", &dbv))
{
- mir_strncpy((char*)wparam, dbv.pszVal, (int)lparam);
+ strncpy((char*)wparam, dbv.pszVal, (int)lparam);
db_free(&dbv);
return 0;
}
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index 0b4ccc956d..05658e1ac8 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -211,7 +211,7 @@ char* GetLaunchPath(char*launch) if (launch == NULL) return temp; - mir_strncpy(temp, launch, XFIRE_MAX_STATIC_STRING_LEN -1); + strncpy(temp, launch, XFIRE_MAX_STATIC_STRING_LEN -1); while (*p != 0 && *f != 0) { diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp index dd1d038f30..70f167e933 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -23,7 +23,7 @@ char* Varxfiregame(ARGUMENTSINFO *ai) DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "RGame", &dbv3))
{
- mir_strncpy(temp, dbv3.pszVal, 255);
+ strncpy(temp, dbv3.pszVal, 255);
db_free(&dbv3);
return mir_strdup(temp);
}
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index a269030c33..5b35f6b3d9 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -246,7 +246,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) AI.cbSize = sizeof AI;
AI.format = PA_FORMAT_PNG;
AI.hContact = hContact;
- mir_tstrncpy(AI.filename, buf, SIZEOF(AI.filename)-1);
+ _tcsncpy(AI.filename, buf, SIZEOF(AI.filename)-1);
if (error)
setDword(hContact, "PictCK", 0);
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index a2a20516cd..58c9089d4d 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -289,7 +289,7 @@ const char* CYahooProto::find_buddy( const char *yahoo_id) if (GetStringUtf(hContact, "Nick", &dbv))
return NULL;
- mir_strncpy(nick, dbv.pszVal, sizeof(nick)-1);
+ strncpy(nick, dbv.pszVal, sizeof(nick)-1);
db_free(&dbv);
return nick;
}
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp index 510b6b2abf..b5b65f8d40 100644 --- a/src/core/miranda.cpp +++ b/src/core/miranda.cpp @@ -363,7 +363,7 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam) UINT blockSize;
VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\ProductVersion"), (LPVOID*)&productVersion, &blockSize);
- mir_strncpy((char*)lParam, _T2A(productVersion), wParam);
+ strncpy((char*)lParam, _T2A(productVersion), wParam);
#if defined(_WIN64)
strcat_s((char*)lParam, wParam, " x64");
#endif
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 62ad5f08a7..48b31036a2 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -286,31 +286,31 @@ static void OnLoadSettings() static void RegisterFonts()
{
ColourIDT colourid = { sizeof(colourid) };
- mir_strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
- mir_tstrncpy(colourid.group, LPGENT("Chat module"), SIZEOF(colourid.group));
+ strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
+ _tcsncpy(colourid.group, LPGENT("Chat module"), SIZEOF(colourid.group));
- mir_strncpy(colourid.setting, "ColorLogBG", SIZEOF(colourid.setting));
- mir_tstrncpy(colourid.name, LPGENT("Group chat log background"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "ColorLogBG", SIZEOF(colourid.setting));
+ _tcsncpy(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));
- mir_tstrncpy(colourid.name, LPGENT("Message background"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "ColorMessageBG", SIZEOF(colourid.setting));
+ _tcsncpy(colourid.name, LPGENT("Message background"), SIZEOF(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
- mir_strncpy(colourid.setting, "ColorNicklistBG", SIZEOF(colourid.setting));
- mir_tstrncpy(colourid.name, LPGENT("Nick list background"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "ColorNicklistBG", SIZEOF(colourid.setting));
+ _tcsncpy(colourid.name, LPGENT("Nick list background"), SIZEOF(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
- mir_strncpy(colourid.setting, "ColorNicklistLines", SIZEOF(colourid.setting));
- mir_tstrncpy(colourid.name, LPGENT("Nick list lines"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "ColorNicklistLines", SIZEOF(colourid.setting));
+ _tcsncpy(colourid.name, LPGENT("Nick list lines"), SIZEOF(colourid.name));
colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER);
ColourRegisterT(&colourid);
- mir_strncpy(colourid.setting, "ColorNicklistSelectedBG", SIZEOF(colourid.setting));
- mir_tstrncpy(colourid.name, LPGENT("Nick list background (selected)"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "ColorNicklistSelectedBG", SIZEOF(colourid.setting));
+ _tcsncpy(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 35f1f78962..02ae7b298e 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -53,8 +53,8 @@ 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));
- mir_tstrncpy(fontid.group, LPGENT("Contact list"), SIZEOF(fontid.group));
+ strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup));
+ _tcsncpy(fontid.group, LPGENT("Contact list"), SIZEOF(fontid.group));
HDC hdc = GetDC(NULL);
for (int i = 0; i < SIZEOF(clistFontDescr); i++) {
@@ -70,11 +70,11 @@ void RegisterCListFonts() fontid.flags &= ~FIDF_CLASSMASK;
fontid.flags |= clistFontDescr[i].iMask;
- mir_tstrncpy(fontid.name, clistFontDescr[i].tszName, SIZEOF(fontid.name));
+ _tcsncpy(fontid.name, clistFontDescr[i].tszName, SIZEOF(fontid.name));
char idstr[10];
mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i);
- mir_strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
fontid.order = i;
FontRegisterT(&fontid);
}
@@ -84,28 +84,28 @@ void RegisterCListFonts() ColourIDT colourid = { 0 };
colourid.cbSize = sizeof(ColourIDT);
colourid.order = 0;
- mir_strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
+ strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
- mir_strncpy(colourid.setting, "BkColour", sizeof(colourid.setting));
- mir_tstrncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name));
- mir_tstrncpy(colourid.group, LPGENT("Contact list"), SIZEOF(colourid.group));
+ strncpy(colourid.setting, "BkColour", sizeof(colourid.setting));
+ _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name));
+ _tcsncpy(colourid.group, LPGENT("Contact list"), SIZEOF(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
ColourRegisterT(&colourid);
- mir_strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
- mir_tstrncpy(colourid.name, LPGENT("Selected text"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
+ _tcsncpy(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));
- mir_tstrncpy(colourid.name, LPGENT("Hottrack text"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
+ _tcsncpy(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));
- mir_tstrncpy(colourid.name, LPGENT("Quicksearch text"), SIZEOF(colourid.name));
+ strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
+ _tcsncpy(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 124ca9e37d..81b1a220ba 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;
- mir_tstrncpy(filter, TranslateT("All files"),SIZEOF(filter)-1);
+ _tcsncpy(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 5e50b02df8..ccfaa427e2 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) {
- mir_tstrncpy(str, result, strSize);
+ _tcsncpy(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) {
- mir_tstrncpy(tszTemp, result, SIZEOF(tszTemp));
+ _tcsncpy(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 fa203b42b5..f7e1ddeb2a 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))
- mir_tstrncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, SIZEOF(lf->lfFaceName)-1);
+ _tcsncpy(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 fab500fa2d..176a761ac4 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);
- mir_tstrncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
+ _tcsncpy(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;
}
- mir_tstrncpy(str, (const TCHAR*)pszSrc, cbStr);
+ _tcsncpy(str, (const TCHAR*)pszSrc, cbStr);
str[cbStr-1] = 0;
mir_free(pszTmp);
}
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 91b1f170b4..2e7ef5de9e 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -282,7 +282,7 @@ static INT_PTR GetProfilePath(WPARAM wParam, LPARAM lParam) return 1;
char *dst = (char*)lParam;
- mir_strncpy(dst, _T2A(g_profileDir), wParam);
+ strncpy(dst, _T2A(g_profileDir), wParam);
dst[wParam-1] = 0;
return 0;
}
@@ -295,7 +295,7 @@ static INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) char *dst = (char*)lParam;
char *tmp = makeFileName(g_profileName);
- mir_strncpy(dst, tmp, wParam);
+ strncpy(dst, tmp, wParam);
mir_free(tmp);
dst[wParam-1] = 0;
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 45f79e0713..6efdc67f7d 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -149,7 +149,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte mir_snprintf(buff, SIZEOF(buff), "\n[%s]", F.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
- mir_strncpy(header, buff, SIZEOF(header));
+ strncpy(header, buff, SIZEOF(header));
WriteLine(out, buff);
}
diff --git a/src/modules/fonts/FontService.cpp b/src/modules/fonts/FontService.cpp index d8f6dac156..166110f2a8 100644 --- a/src/modules/fonts/FontService.cpp +++ b/src/modules/fonts/FontService.cpp @@ -90,22 +90,22 @@ int LoadFontserviceModule(void) // create generic fonts
FontIDT fontid = { sizeof(fontid) };
- mir_strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
+ strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
_tcsncpy_s(fontid.group, LPGENT("General"), _TRUNCATE);
_tcsncpy_s(fontid.name, LPGENT("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
- mir_strncpy(fontid.prefix, "Header", SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, "Header", SIZEOF(fontid.prefix));
FontRegisterT(&fontid);
_tcsncpy_s(fontid.name, LPGENT("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
- mir_strncpy(fontid.prefix, "Generic", SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, "Generic", SIZEOF(fontid.prefix));
FontRegisterT(&fontid);
_tcsncpy_s(fontid.name, LPGENT("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
- mir_strncpy(fontid.prefix, "Small", SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, "Small", SIZEOF(fontid.prefix));
FontRegisterT(&fontid);
// do last for silly dyna plugin
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index 3d50e8a455..f550d4edbd 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -83,7 +83,7 @@ INT_PTR Meta_GetName(WPARAM wParam, LPARAM lParam) {
char *name = (char *)Translate(META_PROTO);
size_t size = min(mir_strlen(name), wParam - 1); // copy only the first size bytes.
- if (mir_strncpy((char *)lParam, name, size) == NULL)
+ if (strncpy((char *)lParam, name, size) == NULL)
return 1;
((char *)lParam)[size] = '\0';
return 0;
@@ -243,7 +243,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam, LPARAM lParam) tfap->hContact = ccs->hContact;
tfap->hEvent = hEvent;
tfap->id = 10;
- mir_strncpy(tfap->msg, Translate("No online contacts found."), SIZEOF(tfap->msg) - 1);
+ strncpy(tfap->msg, Translate("No online contacts found."), SIZEOF(tfap->msg) - 1);
CloseHandle(mir_forkthread(sttFakeAckFail, (void*)tfap));
SetEvent(hEvent);
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index a30a15f2bf..cd7a173f1a 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -583,7 +583,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + mir_strlen(tmpUrl) * 3 + 1);
- mir_strncpy(nlc->szNewUrl, pszFullUrl, rlen);
+ strncpy(nlc->szNewUrl, pszFullUrl, rlen);
mir_strcpy(nlc->szNewUrl + rlen, tmpUrl);
pszFullUrl = nlc->szNewUrl;
pszUrl = NULL;
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index a00f667076..31873e94a7 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -292,7 +292,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, size_t newLoginLen = mir_tstrlen(login) + domainLen + 1;
TCHAR *newLogin = (TCHAR*)alloca(newLoginLen * sizeof(TCHAR));
- mir_tstrncpy(newLogin, domainName, domainLen);
+ _tcsncpy(newLogin, domainName, domainLen);
newLogin[domainLen] = '\\';
mir_tstrcpy(newLogin + domainLen + 1, login);
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index 5aaea3613a..e53e73bd89 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -237,7 +237,7 @@ void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo) connInfo->dwIpv4 = sin.si_family == AF_INET ? htonl(sin.Ipv4.sin_addr.s_addr) : 0;
char *szTmp = NetlibAddressToString(&sin);
- mir_strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
+ strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
connInfo->szIpPort[sizeof(connInfo->szIpPort) - 1] = 0;
mir_free(szTmp);
}
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index 54fc04d640..2e3445126f 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -147,7 +147,7 @@ static bool txtParseParam(char* szData, char* presearch, while (*(cp1-1) == ' ' && cp1 > cp) --cp1;
len = min((size_t)(cp1 - cp), size-1);
- mir_strncpy(param, cp, len);
+ strncpy(param, cp, len);
param[len] = 0;
return true;
@@ -171,7 +171,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) if (szHost != NULL) {
sz = pport - phost + 1;
if (sz > 256) sz = 256;
- mir_strncpy(szHost, phost, sz);
+ strncpy(szHost, phost, sz);
szHost[sz - 1] = 0;
}
@@ -185,7 +185,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) }
if (szPath != NULL) {
- mir_strncpy(szPath, ppath, 256);
+ strncpy(szPath, ppath, 256);
szPath[255] = 0;
}
}
@@ -514,7 +514,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl) size_t ctlLen;
txtParseParam(szData, NULL, "<URLBase>", "</URLBase>", szTemp, sizeof(szTemp));
- mir_strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
+ strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
@@ -541,11 +541,11 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl) size_t ctlCLen = mir_strlen(szCtlUrl);
rpth = szCtlUrl + ctlCLen;
if (ctlCLen != 0 && *(rpth - 1) != '/')
- mir_strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen);
+ strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen);
}
ctlLen = sizeof(szCtlUrl) - (rpth - szCtlUrl);
- mir_strncpy(rpth, szUrl, ctlLen);
+ strncpy(rpth, szUrl, ctlLen);
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
}
else {
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp index b664922f49..be760d9877 100644 --- a/src/modules/protocols/protochains.cpp +++ b/src/modules/protocols/protochains.cpp @@ -34,7 +34,7 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen) DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
if (cc && cc->szProto != NULL) {
- mir_strncpy(szBuf, cc->szProto, cbLen);
+ strncpy(szBuf, cc->szProto, cbLen);
szBuf[cbLen - 1] = 0;
return 0;
}
|