From 2a815f8820ca402626bd283dd5b75744ddeb9812 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 May 2015 18:55:59 +0000 Subject: mir_tstrncpy <> _tcsncpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13791 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AVS/src/cache.cpp | 2 +- plugins/AVS/src/utils.cpp | 2 +- plugins/Alarms/src/frame.cpp | 10 +-- plugins/BossKeyPlus/src/BossKey.cpp | 2 +- plugins/BuddyExpectator/src/BuddyExpectator.cpp | 12 ++-- plugins/BuddyExpectator/src/options.cpp | 6 +- plugins/ChangeKeyboardLayout/src/options.cpp | 4 +- .../ChangeKeyboardLayout/src/text_operations.cpp | 8 +-- .../ClientChangeNotify/src/ClientChangeNotify.cpp | 4 +- .../ClientChangeNotify/src/CommonLibs/CString.h | 2 +- plugins/Clist_nicer/src/clcitems.cpp | 4 +- plugins/Clist_nicer/src/clui.cpp | 34 +++++----- plugins/Clist_nicer/src/extBackg.cpp | 2 +- plugins/Clist_nicer/src/viewmodes.cpp | 10 +-- plugins/CmdLine/MimCmd/src/commands.cpp | 2 +- plugins/CmdLine/src/utils.cpp | 6 +- plugins/ConnectionNotify/src/debug.cpp | 6 +- plugins/ConnectionNotify/src/netstat.cpp | 4 +- plugins/CrashDumper/src/dumper.cpp | 2 +- plugins/CrashDumper/src/upload.cpp | 2 +- plugins/DbChecker/src/main.cpp | 2 +- plugins/DbEditorPP/src/copymodule.cpp | 2 +- plugins/DbEditorPP/src/exportimport.cpp | 8 +-- plugins/DbEditorPP/src/headers.h | 2 +- plugins/DbEditorPP/src/main.cpp | 6 +- plugins/Exchange/src/MirandaExchange.cpp | 2 +- plugins/Exchange/src/utils.cpp | 14 ++-- plugins/FTPFileYM/src/manager.cpp | 2 +- plugins/FloatingContacts/src/filedrop.cpp | 6 +- plugins/FloatingContacts/src/main.cpp | 4 +- plugins/FloatingContacts/src/thumbs.cpp | 2 +- plugins/Folders/src/services.cpp | 4 +- plugins/Folders/src/utils.cpp | 4 +- plugins/HTTPServer/src/GuiElements.cpp | 8 +-- plugins/HTTPServer/src/HttpUser.cpp | 4 +- plugins/HTTPServer/src/IndexHTML.cpp | 14 ++-- plugins/HTTPServer/src/IndexXML.cpp | 16 ++--- plugins/IEView/src/ScriverHTMLBuilder.cpp | 4 +- plugins/IEView/src/TemplateHTMLBuilder.cpp | 4 +- plugins/ListeningTo/src/listeningto.cpp | 2 +- plugins/LotusNotify/src/LotusNotify.cpp | 4 +- plugins/MenuItemEx/src/main.cpp | 10 +-- plugins/MirOTR/src/dbfilter.cpp | 6 +- plugins/MirOTR/src/striphtml.cpp | 2 +- plugins/MirOTR/src/utils.cpp | 8 +-- .../MirandaG15/src/LCDFramework/CLCDTextObject.cpp | 2 +- plugins/NewAwaySysMod/src/CString.h | 2 +- plugins/NewEventNotify/src/popup.cpp | 10 +-- plugins/NewXstatusNotify/src/indsnd.cpp | 4 +- plugins/NewXstatusNotify/src/main.cpp | 12 ++-- plugins/NewXstatusNotify/src/options.cpp | 18 ++--- plugins/NewXstatusNotify/src/popup.cpp | 4 +- plugins/NewXstatusNotify/src/utils.cpp | 4 +- plugins/NewXstatusNotify/src/xstatus.cpp | 6 +- plugins/New_GPG/src/main.cpp | 12 ++-- plugins/New_GPG/src/messages.cpp | 6 +- plugins/New_GPG/src/options.cpp | 2 +- plugins/New_GPG/src/utilities.cpp | 8 +-- plugins/Non-IM Contact/src/namereplacing.cpp | 8 +-- plugins/NotesAndReminders/src/options.cpp | 26 ++++---- plugins/NotesAndReminders/src/reminders.cpp | 2 +- plugins/NotifyAnything/src/main.cpp | 4 +- plugins/Nudge/src/nudge.cpp | 12 ++-- plugins/RemovePersonalSettings/src/rps.cpp | 2 +- plugins/Scriver/src/infobar.cpp | 4 +- plugins/Scriver/src/msgdialog.cpp | 2 +- plugins/Scriver/src/msgoptions.cpp | 18 ++--- plugins/Scriver/src/utils.cpp | 4 +- plugins/SecureIM/src/commonheaders.cpp | 4 +- plugins/SecureIM/src/crypt_lists.cpp | 2 +- plugins/SecureIM/src/main.cpp | 8 +-- plugins/SecureIM/src/options.cpp | 8 +-- plugins/SecureIM/src/svcs_proto.cpp | 2 +- plugins/SeenPlugin/src/options.cpp | 4 +- plugins/SeenPlugin/src/utils.cpp | 36 +++++----- plugins/Sessions/Src/Utils.cpp | 2 +- plugins/SimpleStatusMsg/src/main.cpp | 6 +- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 2 +- plugins/SmileyAdd/src/download.cpp | 2 +- plugins/Spamotron/src/options.cpp | 10 +-- plugins/SpellChecker/src/utils.cpp | 2 +- plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 6 +- plugins/StatusPlugins/KeepStatus/options.cpp | 4 +- plugins/StatusPlugins/StartupStatus/profiles.cpp | 4 +- plugins/TabSRMM/src/chat/options.cpp | 78 +++++++++++----------- plugins/TabSRMM/src/chat/services.cpp | 2 +- plugins/TabSRMM/src/container.cpp | 2 +- plugins/TabSRMM/src/controls.cpp | 2 +- plugins/TabSRMM/src/eventpopups.cpp | 6 +- plugins/TabSRMM/src/generic_msghandlers.cpp | 6 +- plugins/TabSRMM/src/msgdlgutils.cpp | 4 +- plugins/TabSRMM/src/msglog.cpp | 4 +- plugins/TabSRMM/src/msgs.cpp | 4 +- plugins/TabSRMM/src/selectcontainer.cpp | 2 +- plugins/TabSRMM/src/sendlater.cpp | 6 +- plugins/TabSRMM/src/themes.cpp | 2 +- plugins/TabSRMM/src/utils.cpp | 4 +- plugins/TipperYM/src/mir_smileys.cpp | 6 +- plugins/TipperYM/src/options.cpp | 38 +++++------ plugins/TipperYM/src/popwin.cpp | 8 +-- plugins/TipperYM/src/subst.cpp | 16 ++--- plugins/TipperYM/src/translations.cpp | 12 ++-- plugins/TooltipNotify/src/TooltipNotify.cpp | 26 ++++---- plugins/TrafficCounter/src/TrafficCounter.cpp | 8 +-- plugins/TrafficCounter/src/misc.cpp | 6 +- plugins/UserGuide/src/main.cpp | 6 +- plugins/Utils/mir_buffer.h | 2 +- plugins/Variables/src/parse_alias.cpp | 2 +- plugins/Variables/src/parse_inet.cpp | 4 +- plugins/Variables/src/parse_str.cpp | 18 ++--- plugins/Variables/src/parse_system.cpp | 6 +- plugins/Variables/src/variables.cpp | 4 +- plugins/Weather/src/weather_addstn.cpp | 10 +-- plugins/Weather/src/weather_contacts.cpp | 10 +-- plugins/Weather/src/weather_data.cpp | 36 +++++----- plugins/Weather/src/weather_info.cpp | 2 +- plugins/Weather/src/weather_ini.cpp | 6 +- plugins/Weather/src/weather_opt.cpp | 22 +++--- plugins/Weather/src/weather_popup.cpp | 8 +-- plugins/Weather/src/weather_svcs.cpp | 2 +- plugins/Weather/src/weather_update.cpp | 6 +- plugins/Weather/src/weather_userinfo.cpp | 2 +- plugins/WebView/src/webview_alerts.cpp | 6 +- plugins/WebView/src/webview_cleanup.cpp | 34 +++++----- plugins/WebView/src/webview_datawnd.cpp | 2 +- plugins/WebView/src/webview_getdata.cpp | 4 +- plugins/WebView/src/webview_services.cpp | 4 +- plugins/WhenWasIt/src/notifiers.cpp | 4 +- plugins/WhenWasIt/src/services.cpp | 4 +- plugins/WhenWasIt/src/utils.cpp | 8 +-- plugins/WhoUsesMyFiles/src/wumfplug.cpp | 2 +- plugins/XSoundNotify/src/Common.h | 2 +- plugins/XSoundNotify/src/dialog.cpp | 2 +- plugins/XSoundNotify/src/options.cpp | 2 +- plugins/YAMN/src/browser/mailbrowser.cpp | 2 +- plugins/YAMN/src/mails/decode.cpp | 2 +- plugins/YAMN/src/mails/mails.cpp | 2 +- plugins/YAMN/src/main.cpp | 2 +- plugins/YAPP/src/services.cpp | 2 +- plugins/YAPP/src/yapp_history_dlg.cpp | 4 +- plugins/YARelay/src/main.cpp | 6 +- plugins/YahooGroups/src/utils.cpp | 10 +-- plugins/helpers/gen_helpers.cpp | 4 +- plugins/wbOSD/src/events.cpp | 2 +- 144 files changed, 518 insertions(+), 518 deletions(-) (limited to 'plugins') 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<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(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> 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(""), MAX_DATA_LEN - 1); + else _tcsncpy(str, TranslateT(""), 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(""), MAX_DATA_LEN); + _tcsncpy(Data, TranslateT(""), 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)) { -- cgit v1.2.3