summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 18:51:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 18:51:36 +0000
commit688f55ba998c19304a29727c910504903f4cc49a (patch)
tree69121ebb6d02bcf9e670428b11813087fc7f1640
parent4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (diff)
lstr* replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/AVS/src/acc.cpp4
-rw-r--r--plugins/AVS/src/options.cpp16
-rw-r--r--plugins/AVS/src/services.cpp4
-rw-r--r--plugins/AVS/src/utils.cpp2
-rw-r--r--plugins/AddContactPlus/src/addcontact.cpp2
-rw-r--r--plugins/Alarms/src/alarmlist.cpp6
-rw-r--r--plugins/Alarms/src/alarms.cpp4
-rw-r--r--plugins/Alarms/src/frame.cpp16
-rw-r--r--plugins/AssocMgr/src/assoclist.cpp2
-rw-r--r--plugins/AssocMgr/src/dde.cpp4
-rw-r--r--plugins/AssocMgr/src/main.cpp10
-rw-r--r--plugins/AssocMgr/src/reg.cpp72
-rw-r--r--plugins/AssocMgr/src/test.cpp14
-rw-r--r--plugins/AssocMgr/src/utils.cpp2
-rw-r--r--plugins/AutoRun/src/main.cpp2
-rw-r--r--plugins/AutoShutdown/src/frame.cpp2
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp2
-rw-r--r--plugins/AutoShutdown/src/utils.cpp34
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp2
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp2
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp6
-rw-r--r--plugins/AvatarHistory/src/popup.cpp6
-rw-r--r--plugins/AvatarHistory/src/utils.cpp6
-rw-r--r--plugins/BASS_interface/src/Main.cpp4
-rw-r--r--plugins/BasicHistory/src/Scheduler.cpp2
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp2
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp6
-rw-r--r--plugins/BuddyPounce/src/main.cpp4
-rw-r--r--plugins/CSList/src/cslist.cpp16
-rw-r--r--plugins/CSList/src/cslist.h8
-rw-r--r--plugins/ClientChangeNotify/src/CommonLibs/CString.h8
-rw-r--r--plugins/ClientChangeNotify/src/Misc.h4
-rw-r--r--plugins/Clist_blind/src/clcpaint.cpp16
-rw-r--r--plugins/Clist_blind/src/init.cpp22
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp50
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp40
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp22
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp6
-rw-r--r--plugins/Clist_nicer/skineditor/src/main.cpp2
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp2
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp10
-rw-r--r--plugins/Clist_nicer/src/clc.cpp6
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp24
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp18
-rw-r--r--plugins/Clist_nicer/src/clcutils.cpp24
-rw-r--r--plugins/Clist_nicer/src/clui.cpp16
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp12
-rw-r--r--plugins/Clist_nicer/src/config.cpp2
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp20
-rw-r--r--plugins/Clist_nicer/src/init.cpp4
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp8
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp4
-rw-r--r--plugins/ContactsPlus/src/utils.cpp2
-rw-r--r--plugins/CountryFlags/src/ip2country.cpp14
-rw-r--r--plugins/CryptoPP/src/PGPw/sdk8.cpp10
-rw-r--r--plugins/DbChecker/src/selectdb.cpp14
-rw-r--r--plugins/DbChecker/src/welcome.cpp2
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp10
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp4
-rw-r--r--plugins/Db_autobackups/src/backup.cpp10
-rw-r--r--plugins/Db_autobackups/src/main.cpp4
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp4
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp14
-rw-r--r--plugins/FavContacts/src/menu.cpp20
-rw-r--r--plugins/FavContacts/src/services.cpp56
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp10
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp2
-rw-r--r--plugins/FloatingContacts/src/bitmap_funcs.cpp12
-rw-r--r--plugins/GmailNotifier/src/check.cpp70
-rw-r--r--plugins/GmailNotifier/src/main.cpp2
-rw-r--r--plugins/GmailNotifier/src/notify.cpp46
-rw-r--r--plugins/GmailNotifier/src/options.cpp4
-rw-r--r--plugins/GmailNotifier/src/utility.cpp8
-rw-r--r--plugins/IEView/src/ChatHTMLBuilder.cpp6
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp2
-rw-r--r--plugins/IEView/src/HistoryHTMLBuilder.cpp6
-rw-r--r--plugins/IEView/src/MUCCHTMLBuilder.cpp6
-rw-r--r--plugins/IEView/src/ScriverHTMLBuilder.cpp6
-rw-r--r--plugins/IEView/src/TabSRMMHTMLBuilder.cpp6
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp2
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp4
-rw-r--r--plugins/ListeningTo/src/players/generic.cpp2
-rw-r--r--plugins/LotusNotify/src/LotusNotify.cpp2
-rw-r--r--plugins/MenuItemEx/src/main.cpp6
-rw-r--r--plugins/MirOTR/MirOTR/src/svcs_proto.cpp6
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp4
-rw-r--r--plugins/MirandaG15/src/CConfig.cpp4
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp2
-rw-r--r--plugins/ModernOpt/src/mopt_selector.cpp12
-rw-r--r--plugins/MsgPopup/src/main.cpp4
-rw-r--r--plugins/MyDetails/src/data.cpp14
-rw-r--r--plugins/MyDetails/src/services.cpp10
-rw-r--r--plugins/NewAwaySysMod/src/CString.h8
-rw-r--r--plugins/NewAwaySysMod/src/GroupCheckbox.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/Notification.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp2
-rw-r--r--plugins/NewEventNotify/src/popup.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp192
-rw-r--r--plugins/NewXstatusNotify/src/utils.cpp12
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.cpp22
-rw-r--r--plugins/NewsAggregator/Src/Services.cpp4
-rw-r--r--plugins/Non-IM Contact/src/contactinfo.cpp2
-rw-r--r--plugins/Non-IM Contact/src/files.cpp2
-rw-r--r--plugins/Non-IM Contact/src/http.cpp4
-rw-r--r--plugins/Non-IM Contact/src/services.cpp2
-rw-r--r--plugins/Nudge/src/main.cpp6
-rw-r--r--plugins/PackUpdater/Src/Notifications.cpp18
-rw-r--r--plugins/PackUpdater/Src/PackUpdater.cpp2
-rw-r--r--plugins/PackUpdater/Src/Utils.cpp18
-rw-r--r--plugins/Ping/src/pingthread.cpp12
-rw-r--r--plugins/Popup/src/actions.cpp6
-rw-r--r--plugins/Popup/src/bitmap_funcs.cpp12
-rw-r--r--plugins/Popup/src/font.cpp44
-rw-r--r--plugins/Popup/src/font.h2
-rw-r--r--plugins/Popup/src/notifications.cpp22
-rw-r--r--plugins/Popup/src/opt_class.cpp8
-rw-r--r--plugins/Popup/src/opt_gen.cpp26
-rw-r--r--plugins/Popup/src/opt_skins.cpp12
-rw-r--r--plugins/Popup/src/opttree.cpp4
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp26
-rw-r--r--plugins/Popup/src/skin.cpp30
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp18
-rw-r--r--plugins/Quotes/src/Chart.h2
-rw-r--r--plugins/Quotes/src/Forex.cpp2
-rw-r--r--plugins/Quotes/src/ImportExport.cpp12
-rw-r--r--plugins/Quotes/src/QuotesProviderBase.cpp6
-rw-r--r--plugins/Quotes/src/SettingsDlg.cpp2
-rw-r--r--plugins/SMS/src/SMS_svc.cpp2
-rw-r--r--plugins/SMS/src/functions.cpp6
-rw-r--r--plugins/SMS/src/receive.cpp2
-rw-r--r--plugins/SMS/src/senddlg.cpp6
-rw-r--r--plugins/Scriver/src/chat/log.cpp2
-rw-r--r--plugins/Scriver/src/chat/message.cpp8
-rw-r--r--plugins/Scriver/src/chat/options.cpp6
-rw-r--r--plugins/Scriver/src/chat/tools.cpp6
-rw-r--r--plugins/Scriver/src/chat/window.cpp18
-rw-r--r--plugins/Scriver/src/globals.cpp2
-rw-r--r--plugins/Scriver/src/input.cpp4
-rw-r--r--plugins/Scriver/src/msgdialog.cpp18
-rw-r--r--plugins/Scriver/src/msglog.cpp20
-rw-r--r--plugins/Scriver/src/msgoptions.cpp2
-rw-r--r--plugins/Scriver/src/msgwindow.cpp16
-rw-r--r--plugins/Scriver/src/utils.cpp4
-rw-r--r--plugins/SecureIM/src/commonheaders.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.cpp14
-rw-r--r--plugins/ShellExt/src/main.cpp2
-rw-r--r--plugins/ShellExt/src/shlcom.cpp32
-rw-r--r--plugins/ShellExt/src/shlext.cpp18
-rw-r--r--plugins/ShellExt/src/utils.cpp2
-rw-r--r--plugins/SimpleAR/src/Main.cpp2
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp8
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp70
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp6
-rw-r--r--plugins/SimpleStatusMsg/src/options.cpp22
-rw-r--r--plugins/SmileyAdd/src/download.cpp2
-rw-r--r--plugins/SmileyAdd/src/options.cpp4
-rw-r--r--plugins/SpellChecker/src/RichEdit.cpp6
-rw-r--r--plugins/SpellChecker/src/ardialog.cpp2
-rw-r--r--plugins/SpellChecker/src/autoreplace.cpp6
-rw-r--r--plugins/SpellChecker/src/dictionary.cpp36
-rw-r--r--plugins/SpellChecker/src/options.cpp12
-rw-r--r--plugins/SpellChecker/src/utils.cpp36
-rw-r--r--plugins/SplashScreen/src/bitmap_funcs.cpp4
-rw-r--r--plugins/SplashScreen/src/options.cpp4
-rw-r--r--plugins/StatusPlugins/commonstatus.cpp10
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp8
-rw-r--r--plugins/TabSRMM/src/TSButton.cpp4
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp32
-rw-r--r--plugins/TabSRMM/src/chat/message.cpp8
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp10
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp10
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp36
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp4
-rw-r--r--plugins/TabSRMM/src/container.cpp10
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp12
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp18
-rw-r--r--plugins/TabSRMM/src/globals.cpp6
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp20
-rw-r--r--plugins/TabSRMM/src/mim.cpp12
-rw-r--r--plugins/TabSRMM/src/modplus.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp18
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp24
-rw-r--r--plugins/TabSRMM/src/msglog.cpp10
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp6
-rw-r--r--plugins/TabSRMM/src/msgs.cpp12
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp6
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp14
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp36
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp6
-rw-r--r--plugins/TabSRMM/src/srmm.cpp2
-rw-r--r--plugins/TabSRMM/src/templates.cpp4
-rw-r--r--plugins/TabSRMM/src/themeio.cpp4
-rw-r--r--plugins/TabSRMM/src/themes.cpp22
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp2
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp16
-rw-r--r--plugins/TabSRMM/src/utils.cpp52
-rw-r--r--plugins/TipperYM/src/message_pump.cpp2
-rw-r--r--plugins/TipperYM/src/mir_smileys.cpp4
-rw-r--r--plugins/TooltipNotify/src/Tooltip.cpp4
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp12
-rw-r--r--plugins/TrafficCounter/src/TrafficCounter.cpp10
-rw-r--r--plugins/TrafficCounter/src/opttree.cpp4
-rw-r--r--plugins/TranslitSwitcher/src/Layoutproc.cpp2
-rw-r--r--plugins/UserInfoEx/src/psp_profile.cpp2
-rw-r--r--plugins/Utils/mir_buffer.h4
-rw-r--r--plugins/Utils/mir_fonts.cpp26
-rw-r--r--plugins/Utils/mir_options.cpp14
-rw-r--r--plugins/Utils/mir_smileys.cpp2
-rw-r--r--plugins/Variables/src/parse_regexp.cpp4
-rw-r--r--plugins/WebView/src/webview.cpp6
-rw-r--r--plugins/WebView/src/webview_alerts.cpp4
-rw-r--r--plugins/WebView/src/webview_cleanup.cpp12
-rw-r--r--plugins/WebView/src/webview_datawnd.cpp4
-rw-r--r--plugins/WebView/src/webview_getdata.cpp16
-rw-r--r--plugins/WebView/src/webview_services.cpp8
-rw-r--r--plugins/WhoUsesMyFiles/src/wumfplug.cpp6
-rw-r--r--plugins/YAMN/src/account.cpp4
-rw-r--r--plugins/YAMN/src/browser/badconnect.cpp16
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp26
-rw-r--r--plugins/YAMN/src/mails/mails.cpp6
-rw-r--r--plugins/YAMN/src/main.cpp2
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3opt.cpp18
-rw-r--r--plugins/YAMN/src/services.cpp10
-rw-r--r--plugins/mTextControl/src/FormattedTextDraw.cpp10
-rw-r--r--plugins/mTextControl/src/textusers.cpp4
-rw-r--r--protocols/EmLanProto/src/amdproto.cpp2
-rw-r--r--protocols/EmLanProto/src/mlan.cpp24
-rw-r--r--protocols/GTalkExt/src/avatar.cpp2
-rw-r--r--protocols/GTalkExt/src/handlers.cpp8
-rw-r--r--protocols/GTalkExt/src/inbox.cpp14
-rw-r--r--protocols/GTalkExt/src/notifications.cpp8
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp10
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp34
-rw-r--r--protocols/IRCG/src/input.cpp72
-rw-r--r--protocols/IRCG/src/irc.h11
-rw-r--r--protocols/IRCG/src/irclib.cpp6
-rw-r--r--protocols/IRCG/src/irclib.h4
-rw-r--r--protocols/IRCG/src/ircproto.cpp28
-rw-r--r--protocols/IRCG/src/options.cpp30
-rw-r--r--protocols/IRCG/src/output.cpp2
-rw-r--r--protocols/IRCG/src/scripting.cpp8
-rw-r--r--protocols/IRCG/src/services.cpp40
-rw-r--r--protocols/IRCG/src/tools.cpp72
-rw-r--r--protocols/IRCG/src/ui_utils.cpp4
-rw-r--r--protocols/IRCG/src/userinfo.cpp8
-rw-r--r--protocols/IRCG/src/windows.cpp122
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_filerequests.cpp13
-rw-r--r--protocols/IcqOscarJ/src/icqosc_svcs.cpp4
-rw-r--r--protocols/JabberG/src/jabber.cpp2
-rw-r--r--protocols/JabberG/src/jabber_api.cpp16
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp2
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp8
-rw-r--r--protocols/JabberG/src/jabber_console.cpp8
-rw-r--r--protocols/JabberG/src/jabber_file.cpp2
-rw-r--r--protocols/JabberG/src/jabber_form.cpp4
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp14
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp4
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp6
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp4
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp10
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp6
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp2
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp6
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp2
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp28
-rw-r--r--protocols/JabberG/src/jabber_util.cpp10
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp6
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp16
-rw-r--r--protocols/JabberG/src/ui_utils.cpp12
-rw-r--r--protocols/MRA/src/MraAvatars.cpp4
-rw-r--r--protocols/MRA/src/MraChat.cpp4
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp4
-rw-r--r--protocols/MRA/src/MraIcons.cpp2
-rw-r--r--protocols/MRA/src/MraPopUp.cpp4
-rw-r--r--protocols/MRA/src/MraProto.cpp18
-rw-r--r--protocols/MRA/src/MraRTFMsg.cpp2
-rw-r--r--protocols/MRA/src/MraSendCommand.cpp4
-rw-r--r--protocols/MRA/src/Mra_functions.cpp24
-rw-r--r--protocols/MRA/src/Mra_options.cpp2
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp6
-rw-r--r--protocols/MSN/src/msn_commands.cpp2
-rw-r--r--protocols/MSN/src/msn_p2p.cpp2
-rw-r--r--protocols/SkypeClassic/src/skype.cpp10
-rw-r--r--protocols/SkypeClassic/src/skypeopt.cpp8
-rw-r--r--protocols/SkypeClassic/src/skypesvc.cpp2
-rw-r--r--protocols/SkypeClassic/src/utf8.cpp4
-rw-r--r--protocols/Twitter/src/proto.cpp2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp2
-rw-r--r--protocols/WhatsApp/src/proto.cpp4
-rw-r--r--protocols/Xfire/src/main.cpp6
-rw-r--r--protocols/Xfire/src/options.cpp2
-rw-r--r--protocols/Xfire/src/processbuddyinfo.cpp2
-rw-r--r--protocols/Xfire/src/tools.cpp4
-rw-r--r--protocols/Yahoo/src/avatar.cpp2
-rw-r--r--protocols/Yahoo/src/file_transfer.cpp8
-rw-r--r--protocols/Yahoo/src/im.cpp36
-rw-r--r--protocols/Yahoo/src/libyahoo2/config.h5
-rw-r--r--protocols/Yahoo/src/libyahoo2/libyahoo2.cpp20
-rw-r--r--protocols/Yahoo/src/proto.cpp34
-rw-r--r--protocols/Yahoo/src/search.cpp4
-rw-r--r--protocols/Yahoo/src/services.cpp37
-rw-r--r--protocols/Yahoo/src/user_info.cpp39
-rw-r--r--protocols/Yahoo/src/util.cpp4
-rw-r--r--protocols/Yahoo/src/yahoo.cpp44
-rw-r--r--src/core/stdauth/authdialogs.cpp2
-rw-r--r--src/core/stdaway/sendmsg.cpp10
-rw-r--r--src/core/stdchat/src/log.cpp2
-rw-r--r--src/core/stdchat/src/options.cpp4
-rw-r--r--src/core/stdchat/src/tools.cpp8
-rw-r--r--src/core/stdchat/src/window.cpp26
-rw-r--r--src/core/stdclist/src/clcpaint.cpp16
-rw-r--r--src/core/stdemail/email.cpp6
-rw-r--r--src/core/stdfile/file.cpp8
-rw-r--r--src/core/stdfile/fileexistsdlg.cpp8
-rw-r--r--src/core/stdfile/filerecvdlg.cpp14
-rw-r--r--src/core/stdfile/filesenddlg.cpp20
-rw-r--r--src/core/stdfile/filexferdlg.cpp16
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp4
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp2
-rw-r--r--src/core/stduihist/history.cpp4
-rw-r--r--src/core/stdurl/urldialogs.cpp14
-rw-r--r--src/core/stduserinfo/contactinfo.cpp24
-rw-r--r--src/core/stduserinfo/stdinfo.cpp4
-rw-r--r--src/mir_core/langpack.cpp2
-rw-r--r--src/mir_core/path.cpp4
-rw-r--r--src/modules/button/button.cpp2
-rw-r--r--src/modules/chat/chat_opts.cpp4
-rw-r--r--src/modules/chat/log.cpp16
-rw-r--r--src/modules/chat/manager.cpp6
-rw-r--r--src/modules/chat/tools.cpp18
-rw-r--r--src/modules/clist/clc.cpp20
-rw-r--r--src/modules/clist/clcfiledrop.cpp10
-rw-r--r--src/modules/clist/clcitems.cpp16
-rw-r--r--src/modules/clist/clcmsgs.cpp10
-rw-r--r--src/modules/clist/clcutils.cpp8
-rw-r--r--src/modules/clist/clisttray.cpp16
-rw-r--r--src/modules/clist/clui.cpp12
-rw-r--r--src/modules/clist/cluiservices.cpp8
-rw-r--r--src/modules/clist/genmenuopt.cpp4
-rw-r--r--src/modules/clist/groups.cpp28
-rw-r--r--src/modules/database/dbini.cpp30
-rw-r--r--src/modules/database/dbutils.cpp2
-rw-r--r--src/modules/findadd/findadd.cpp6
-rw-r--r--src/modules/findadd/searchresults.cpp18
-rw-r--r--src/modules/fonts/FontOptions.cpp4
-rw-r--r--src/modules/fonts/services.cpp2
-rw-r--r--src/modules/icolib/skin2icons.cpp2
-rw-r--r--src/modules/icolib/skin2opts.cpp34
-rw-r--r--src/modules/langpack/langpack.cpp6
-rw-r--r--src/modules/langpack/lpopts.cpp8
-rw-r--r--src/modules/netlib/netlibhttp.cpp2
-rw-r--r--src/modules/netlib/netliblog.cpp10
-rw-r--r--src/modules/netlib/netlibopenconn.cpp6
-rw-r--r--src/modules/netlib/netlibsecurity.cpp8
-rw-r--r--src/modules/options/descbutton.cpp4
-rw-r--r--src/modules/plugins/pluginopts.cpp2
-rw-r--r--src/modules/protocols/protoaccs.cpp2
-rw-r--r--src/modules/protocols/protocols.cpp2
-rw-r--r--src/modules/protocols/protoopts.cpp8
-rw-r--r--src/modules/skin/hotkey_opts.cpp4
-rw-r--r--src/modules/utils/bmpfilter.cpp98
-rw-r--r--src/modules/utils/hyperlink.cpp2
-rw-r--r--src/modules/utils/openurl.cpp2
382 files changed, 2181 insertions, 2238 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp
index 72d9c3b3b6..5930bd8dfb 100644
--- a/plugins/AVS/src/acc.cpp
+++ b/plugins/AVS/src/acc.cpp
@@ -425,7 +425,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (lParam == NULL)
data->proto[0] = '\0';
else
- lstrcpynA(data->proto, GetContactProto(data->hContact), sizeof(data->proto));
+ mir_strncpy(data->proto, GetContactProto(data->hContact), sizeof(data->proto));
StartAnimation(hwnd, data);
@@ -473,7 +473,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return TRUE;
case AVATAR_SETNOAVATARTEXT:
- lstrcpyn(data->noAvatarText, TranslateTS((TCHAR*)lParam), SIZEOF(data->noAvatarText));
+ mir_tstrncpy(data->noAvatarText, TranslateTS((TCHAR*)lParam), SIZEOF(data->noAvatarText));
Invalidate(hwnd);
return TRUE;
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index d6b94ba9a7..0c2b87803c 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -68,8 +68,8 @@ static void RemoveProtoPic(const char *szProto)
if (strstr(szProto, "Global avatar for")) {
char szProtoname[MAX_PATH] = { 0 };
- lstrcpynA(szProtoname, szProto, lstrlenA(szProto) - lstrlenA("accounts"));
- lstrcpyA(szProtoname, strrchr(szProtoname, ' ') + 1);
+ mir_strncpy(szProtoname, szProto, mir_strlen(szProto) - mir_strlen("accounts"));
+ mir_strcpy(szProtoname, strrchr(szProtoname, ' ') + 1);
for (int i = 0; i < g_ProtoPictures.getCount(); i++) {
protoPicCacheEntry& p = g_ProtoPictures[i];
@@ -129,7 +129,7 @@ static void SetProtoPic(char *szProto)
if (!lstrcmpA(AVS_DEFAULT, szProto)) {
for (int i = 0; i < g_ProtoPictures.getCount(); i++) {
protoPicCacheEntry& p = g_ProtoPictures[i];
- if (lstrlenA(p.szProtoname) == 0)
+ if (mir_strlen(p.szProtoname) == 0)
continue;
if (p.hbmPic == 0 || !lstrcmpA(p.szProtoname, AVS_DEFAULT)) {
@@ -140,8 +140,8 @@ static void SetProtoPic(char *szProto)
}
else if (strstr(szProto, "Global avatar for")) {
char szProtoname[MAX_PATH] = { 0 };
- lstrcpynA(szProtoname, szProto, lstrlenA(szProto) - lstrlenA("accounts"));
- lstrcpyA(szProtoname, strrchr(szProtoname, ' ') + 1);
+ mir_strncpy(szProtoname, szProto, mir_strlen(szProto) - mir_strlen("accounts"));
+ mir_strcpy(szProtoname, strrchr(szProtoname, ' ') + 1);
for (int i = 0; i < g_ProtoPictures.getCount(); i++) {
PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)g_ProtoPictures[i].szProtoname);
if (pdescr == NULL && lstrcmpA(g_ProtoPictures[i].szProtoname, szProto))
@@ -149,7 +149,7 @@ static void SetProtoPic(char *szProto)
if (!lstrcmpA(g_ProtoPictures[i].szProtoname, szProto) || !lstrcmpA(pdescr->szProtoName, szProtoname)) {
protoPicCacheEntry& p = g_ProtoPictures[i];
- if (lstrlenA(p.szProtoname) != 0) {
+ if (mir_strlen(p.szProtoname) != 0) {
if (p.hbmPic == 0) {
CreateAvatarInCache(0, &p, szProto);
NotifyEventHooks(hEventChanged, 0, (LPARAM)&p);
@@ -161,10 +161,10 @@ static void SetProtoPic(char *szProto)
else {
for (int i = 0; i < g_ProtoPictures.getCount(); i++) {
protoPicCacheEntry& p = g_ProtoPictures[i];
- if (lstrlenA(p.szProtoname) == 0)
+ if (mir_strlen(p.szProtoname) == 0)
break;
- if (!strcmp(p.szProtoname, szProto) && lstrlenA(p.szProtoname) == lstrlenA(szProto)) {
+ if (!strcmp(p.szProtoname, szProto) && mir_strlen(p.szProtoname) == mir_strlen(szProto)) {
if (p.hbmPic != 0)
DeleteObject(p.hbmPic);
ZeroMemory(&p, sizeof(avatarCacheEntry));
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp
index 3206546bee..7334939f40 100644
--- a/plugins/AVS/src/services.cpp
+++ b/plugins/AVS/src/services.cpp
@@ -750,7 +750,7 @@ INT_PTR DrawAvatarPicture(WPARAM wParam, LPARAM lParam)
for (int i = 0; i < g_ProtoPictures.getCount(); i++) {
protoPicCacheEntry& p = g_ProtoPictures[i];
- if (!lstrcmpA(p.szProtoname, r->szProto) && lstrlenA(r->szProto) == lstrlenA(p.szProtoname) && p.hbmPic != 0) {
+ if (!lstrcmpA(p.szProtoname, r->szProto) && mir_strlen(r->szProto) == mir_strlen(p.szProtoname) && p.hbmPic != 0) {
ace = (AVATARCACHEENTRY *)&g_ProtoPictures[i];
break;
}
@@ -844,7 +844,7 @@ INT_PTR ReportMyAvatarChanged(WPARAM wParam, LPARAM lParam)
continue;
if (!lstrcmpA(g_MyAvatars[i].szProtoname, proto)) {
- LPVOID lpParam = (void *)malloc(lstrlenA(g_MyAvatars[i].szProtoname) + 2);
+ LPVOID lpParam = (void *)malloc(mir_strlen(g_MyAvatars[i].szProtoname) + 2);
strcpy((char *)lpParam, g_MyAvatars[i].szProtoname);
mir_forkthread(ReloadMyAvatar, lpParam);
return 0;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp
index d9a4c07229..fdc16d4338 100644
--- a/plugins/AVS/src/utils.cpp
+++ b/plugins/AVS/src/utils.cpp
@@ -140,7 +140,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
}
}
- if (lstrlen(tszFilename) < 4)
+ if (mir_tstrlen(tszFilename) < 4)
return -1;
_tcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp
index bc33ab425e..caa45fcaca 100644
--- a/plugins/AddContactPlus/src/addcontact.cpp
+++ b/plugins/AddContactPlus/src/addcontact.cpp
@@ -126,7 +126,7 @@ bool AddContactDlgAccounts(HWND hdlg, AddDialogParam *acs)
continue;
cbei.pszText = pAccounts[i]->tszAccountName;
- GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
+ GetTextExtentPoint32(hdc, cbei.pszText, mir_tstrlen(cbei.pszText), &textSize);
if (textSize.cx > cbWidth) cbWidth = textSize.cx;
HICON hIcon = (HICON)CallProtoService(pAccounts[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
cbei.iImage = cbei.iSelectedImage = ImageList_AddIcon(hIml, hIcon);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index eea69fee51..563ad000f0 100644
--- a/plugins/Alarms/src/alarmlist.cpp
+++ b/plugins/Alarms/src/alarmlist.cpp
@@ -331,7 +331,7 @@ void SaveAlarms() {
if (_tcslen(i->szCommand)) {
mir_snprintf(buff, SIZEOF(buff), "ActionCommand%d", index);
db_set_ts(0, MODULE, buff, i->szCommand);
- if (lstrlen(i->szCommandParams)) {
+ if (mir_tstrlen(i->szCommandParams)) {
mir_snprintf(buff, SIZEOF(buff), "ActionParams%d", index);
db_set_ts(0, MODULE, buff, i->szCommandParams);
}
@@ -508,8 +508,8 @@ void ShowPopup(ALARM *alarm)
POPUPDATAT ppd = { 0 };
ppd.lchIcon = hIconMenuSet;
- lstrcpyn(ppd.lptzContactName, data->szTitle, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, data->szDesc, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, data->szTitle, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, data->szDesc, MAX_SECONDLINE);
ppd.PluginWindowProc = PopupAlarmDlgProc;
ppd.PluginData = data;
ppd.iSeconds = -1;
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp
index 5c38706ce8..c3d3a8e1f7 100644
--- a/plugins/Alarms/src/alarms.cpp
+++ b/plugins/Alarms/src/alarms.cpp
@@ -72,8 +72,8 @@ void ShowPopup(MCONTACT hContact, const TCHAR *msg)
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = hIconList1;
- lstrcpyn(ppd.lptzContactName, lpzContactName,MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, msg, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, lpzContactName,MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, msg, MAX_SECONDLINE);
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = RGB(0,0,0);
ppd.PluginWindowProc = PopupDlgProc;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index 2c40ab5270..9a8d48b224 100644
--- a/plugins/Alarms/src/frame.cpp
+++ b/plugins/Alarms/src/frame.cpp
@@ -137,7 +137,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
HICON hIcon = (min <= 5 ? hIconList2 : hIconList1);
DrawIconEx(dis->hDC,dis->rcItem.left,(dis->rcItem.top + dis->rcItem.bottom - 16)>>1,hIcon,0, 0, 0, NULL, DI_NORMAL);
- GetTextExtentPoint32(dis->hDC,alarm.szTitle,lstrlen(alarm.szTitle),&textSize);
+ GetTextExtentPoint32(dis->hDC,alarm.szTitle,mir_tstrlen(alarm.szTitle),&textSize);
TCHAR buff[100];
if (min >= 60)
@@ -145,26 +145,26 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
else
mir_sntprintf(buff, 100, TranslateT("%dm"), min);
- GetTextExtentPoint32(dis->hDC,buff,lstrlen(buff),&timeSize);
+ GetTextExtentPoint32(dis->hDC,buff,mir_tstrlen(buff),&timeSize);
if (textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
// need elipsis
TCHAR titlebuff[512];
- int len = lstrlen(alarm.szTitle);
+ int len = mir_tstrlen(alarm.szTitle);
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--;
_tcsncpy(titlebuff, alarm.szTitle, len);
titlebuff[len] = 0;
_tcscat(titlebuff, _T("..."));
- GetTextExtentPoint32(dis->hDC,titlebuff,lstrlen(titlebuff),&textSize);
+ GetTextExtentPoint32(dis->hDC,titlebuff,mir_tstrlen(titlebuff),&textSize);
}
- TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,titlebuff,lstrlen(titlebuff));
- TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,lstrlen(buff));
+ TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,titlebuff,mir_tstrlen(titlebuff));
+ TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,mir_tstrlen(buff));
}
else {
- TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,alarm.szTitle,lstrlen(alarm.szTitle));
- TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,lstrlen(buff));
+ TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,alarm.szTitle,mir_tstrlen(alarm.szTitle));
+ TextOut(dis->hDC,dis->rcItem.right - timeSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom - timeSize.cy)>>1, buff,mir_tstrlen(buff));
}
SetBkMode(dis->hDC, OPAQUE);
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp
index a1dce06bdf..7d12f4686f 100644
--- a/plugins/AssocMgr/src/assoclist.cpp
+++ b/plugins/AssocMgr/src/assoclist.cpp
@@ -527,7 +527,7 @@ static INT_PTR ServiceAddNewUrlType(WPARAM, LPARAM lParam)
return 1;
if(utd->pszService == NULL)
return 2;
- if(utd->pszProtoPrefix == NULL || utd->pszProtoPrefix[lstrlenA(utd->pszProtoPrefix)-1]!= ':')
+ if(utd->pszProtoPrefix == NULL || utd->pszProtoPrefix[mir_strlen(utd->pszProtoPrefix)-1]!= ':')
return 2;
char *pszClassName = MakeUrlClassName(utd->pszProtoPrefix);
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp
index 71e719e760..641e193359 100644
--- a/plugins/AssocMgr/src/dde.cpp
+++ b/plugins/AssocMgr/src/dde.cpp
@@ -80,7 +80,7 @@ static TCHAR* GetExecuteParam(TCHAR **ppszString)
if(p!=NULL) {
*(p++)=0;
if(fQuoted && *p==_T(',')) p++;
- } else p=&pszParam[lstrlen(pszParam)];
+ } else p=&pszParam[mir_tstrlen(pszParam)];
*ppszString=p;
return pszParam;
}
@@ -173,7 +173,7 @@ static HANDLE StartupMainProcess(TCHAR *pszDatabasePath)
p=_tcsrchr(szPath,_T('\\'));
if(p!=NULL) { *p=0; p=_tcsrchr(szPath,_T('\\')); }
if(p==NULL) return NULL;
- lstrcpy(++p,_T("miranda32.exe"));
+ mir_tstrcpy(++p,_T("miranda32.exe"));
/* inherit startup data from RunDll32 process */
STARTUPINFO si;
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp
index a40c0ecd34..fcf1d3543e 100644
--- a/plugins/AssocMgr/src/main.cpp
+++ b/plugins/AssocMgr/src/main.cpp
@@ -48,27 +48,27 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
{
TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
- if ( !GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
+ if ( !GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-mir_tstrlen(pszFileName)))
return;
TCHAR *p = _tcsrchr(szFileFrom,_T('\\'));
if (p != NULL)
*(++p) = 0;
- lstrcat(szFileFrom,pszFileName); /* buffer safe */
+ mir_tstrcat(szFileFrom,pszFileName); /* buffer safe */
HANDLE hFile = CreateFile(szFileFrom,0,FILE_SHARE_READ,0,OPEN_EXISTING,0,0);
if (hFile == INVALID_HANDLE_VALUE)
return;
CloseHandle(hFile);
- if ( !GetModuleFileName(NULL,szFileTo,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
+ if ( !GetModuleFileName(NULL,szFileTo,SIZEOF(szFileTo)-mir_tstrlen(pszDestSubDir)-mir_tstrlen(pszFileName)))
return;
p = _tcsrchr(szFileTo,_T('\\'));
if (p)
*(++p)=0;
- lstrcat(szFileTo,pszDestSubDir); /* buffer safe */
+ mir_tstrcat(szFileTo,pszDestSubDir); /* buffer safe */
CreateDirectory(szFileTo,NULL);
- lstrcat(szFileTo,pszFileName); /* buffer safe */
+ mir_tstrcat(szFileTo,pszFileName); /* buffer safe */
if ( !MoveFile(szFileFrom,szFileTo) && GetLastError() == ERROR_ALREADY_EXISTS) {
DeleteFile(szFileTo);
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp
index 9fa97d0e61..ded3aca55b 100644
--- a/plugins/AssocMgr/src/reg.cpp
+++ b/plugins/AssocMgr/src/reg.cpp
@@ -98,7 +98,7 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo,
// mir_free() the return value
char *MakeFileClassName(const char *pszFileExt)
{
- int cbLen = lstrlenA(pszFileExt)+12;
+ int cbLen = mir_strlen(pszFileExt)+12;
char *pszClass = (char*)mir_alloc(cbLen);
if (pszClass != NULL)
/* using correctly formated PROGID */
@@ -112,7 +112,7 @@ char *MakeUrlClassName(const char *pszUrl)
char *pszClass = mir_strdup(pszUrl);
if (pszClass != NULL)
/* remove trailing : */
- pszClass[lstrlenA(pszClass)-1]=0;
+ pszClass[mir_strlen(pszClass)-1]=0;
return pszClass;
}
@@ -133,7 +133,7 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
if (p)
*p = 0;
}
- else lstrcpy(szDbFile, _T("%1")); /* buffer safe */
+ else mir_tstrcpy(szDbFile, _T("%1")); /* buffer safe */
if ( !GetModuleFileName(fMirExe ? NULL : hInst, szExe, SIZEOF(szExe)))
return NULL;
@@ -147,7 +147,7 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
/* ensure the command line is not too long */
GetShortPathName(szExe, szExe, SIZEOF(szExe));
/* surround by quotes if failed */
- DWORD len = lstrlen(szExe);
+ DWORD len = mir_tstrlen(szExe);
if ( _tcschr(szExe,_T(' ')) != NULL && (len+2) < SIZEOF(szExe)) {
MoveMemory(szExe, szExe+1, (len+1)*sizeof(TCHAR));
szExe[len+2] = szExe[0] = _T('\"');
@@ -164,7 +164,7 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
{
TCHAR *buf,*pexe,*pargs;
TCHAR szFullExe[MAX_PATH],*pszFilePart;
- buf=lstrcpy((TCHAR*)_alloca((lstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
+ buf=mir_tstrcpy((TCHAR*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
/* split into executable path and arguments */
if (buf[0]==_T('\"')) {
pargs=_tcschr(&buf[1],_T('\"'));
@@ -253,7 +253,7 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const T
HKEY hSubKey;
LONG res=RegCreateKeyEx(hMainKey,pszSubKey,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE,NULL,&hSubKey,NULL);
if (!res) {
- res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(lstrlen(pszVal)+1)*sizeof(TCHAR));
+ res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(mir_tstrlen(pszVal)+1)*sizeof(TCHAR));
RegCloseKey(hSubKey);
}
return res;
@@ -262,10 +262,10 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const T
// hKey must have been opened with KEY_SET_VALUE access right
static void SetRegStrPrefixValue(HKEY hKey,const TCHAR *pszValPrefix,const TCHAR *pszVal)
{
- DWORD dwSize=(lstrlen(pszVal)+lstrlen(pszValPrefix)+1)*sizeof(TCHAR);
+ DWORD dwSize=(mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(TCHAR);
TCHAR *pszStr=(TCHAR*)mir_alloc(dwSize);
if (pszStr==NULL) return;
- lstrcat(lstrcpy(pszStr,pszValPrefix),pszVal); /* buffer safe */
+ mir_tstrcat(mir_tstrcpy(pszStr,pszValPrefix),pszVal); /* buffer safe */
RegSetValueEx(hKey,NULL,0,REG_SZ,(BYTE*)pszStr,dwSize);
mir_free(pszStr);
}
@@ -381,7 +381,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
if ((res=RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,&nMaxValNameLen,&nMaxValSize,NULL,NULL))==ERROR_SUCCESS) {
if (nMaxSubKeyLen>nMaxValNameLen) nMaxValNameLen=nMaxSubKeyLen;
/* prepare buffer */
- nDbPrefixLen=(DWORD)lstrlenA(*param->ppszDbPrefix)+lstrlenA(pszSubKey)+1;
+ nDbPrefixLen=(DWORD)mir_strlen(*param->ppszDbPrefix)+mir_strlen(pszSubKey)+1;
cchName=nDbPrefixLen+nMaxValNameLen+3;
if (cchName>*param->pdwDbPrefixSize) {
pszName=(char*)mir_realloc(*param->ppszDbPrefix,cchName);
@@ -389,7 +389,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
*param->ppszDbPrefix=pszName;
*param->pdwDbPrefixSize=cchName;
}
- lstrcatA(lstrcatA(*param->ppszDbPrefix,pszSubKey),"\\"); /* buffer safe */
+ mir_strcat(mir_strcat(*param->ppszDbPrefix,pszSubKey),"\\"); /* buffer safe */
/* enum values */
pszName=(char*)mir_alloc(nMaxValNameLen+1);
if (nMaxValSize==0) nMaxValSize=1;
@@ -401,7 +401,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
cbData=nMaxValSize;
if ((res=RegEnumValueA(hKey,index++,pszName,&cchName,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
(*param->ppszDbPrefix)[nDbPrefixLen]=0;
- lstrcatA(*param->ppszDbPrefix,pszName); /* buffer safe */
+ mir_strcat(*param->ppszDbPrefix,pszName); /* buffer safe */
ptszName=a2t(pszName);
if (ptszName!=NULL) {
if (!RegQueryValueEx(hKey,ptszName,NULL,&dwType,pData,&cbData)) {
@@ -444,7 +444,7 @@ static void BackupRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPrefi
param.ppszDbPrefix=(char**)&pszDbPrefix;
pszDbPrefix=mir_strdup(pszDbPrefix);
if (pszDbPrefix!=NULL) {
- dwDbPrefixSize=lstrlenA(pszDbPrefix)+1;
+ dwDbPrefixSize=mir_strlen(pszDbPrefix)+1;
BackupRegTree_Worker(hKey,pszSubKey,&param);
mir_free((char*)pszDbPrefix);
}
@@ -461,18 +461,18 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref
DWORD dwType,cbData;
BYTE *pData;
- int nDbPrefixLen=lstrlenA(pszDbPrefix);
- int nPrefixWithSubKeyLen=nDbPrefixLen+lstrlenA(pszSubKey)+1;
+ int nDbPrefixLen=mir_strlen(pszDbPrefix);
+ int nPrefixWithSubKeyLen=nDbPrefixLen+mir_strlen(pszSubKey)+1;
char *pszPrefixWithSubKey=(char*)mir_alloc(nPrefixWithSubKeyLen+1);
if (pszPrefixWithSubKey==NULL) return ERROR_OUTOFMEMORY;
- lstrcatA(lstrcatA(lstrcpyA(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
+ mir_strcat(mir_strcat(mir_strcpy(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
LONG res=ERROR_NO_MORE_ITEMS;
if (pszPrefixWithSubKey!=NULL) {
if (EnumDbPrefixSettings("AssocMgr",pszPrefixWithSubKey,&ppszSettings,&nSettingsCount)) {
for(i=0;i<nSettingsCount;++i) {
pszSuffix=&ppszSettings[i][nDbPrefixLen];
/* key hierachy */
- pkeys=lstrcpyA((char*)_alloca(lstrlenA(pszSuffix)+1),pszSuffix);
+ pkeys=mir_strcpy((char*)_alloca(mir_strlen(pszSuffix)+1),pszSuffix);
pnext=pkeys;
while((pnext=strchr(pnext+1,_T('\\')))!=NULL) pslash=pnext;
if (pslash!=NULL) {
@@ -512,9 +512,9 @@ static void DeleteRegTreeBackup(const char *pszSubKey,const char *pszDbPrefix)
char **ppszSettings;
int nSettingsCount,i;
- char *pszPrefixWithSubKey=(char*)mir_alloc(lstrlenA(pszDbPrefix)+lstrlenA(pszSubKey)+2);
+ char *pszPrefixWithSubKey=(char*)mir_alloc(mir_strlen(pszDbPrefix)+mir_strlen(pszSubKey)+2);
if (pszPrefixWithSubKey==NULL) return;
- lstrcatA(lstrcatA(lstrcpyA(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
+ mir_strcat(mir_strcat(mir_strcpy(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
if (pszPrefixWithSubKey!=NULL) {
if (EnumDbPrefixSettings("AssocMgr",pszPrefixWithSubKey,&ppszSettings,&nSettingsCount)) {
for(i=0;i<nSettingsCount;++i) {
@@ -594,7 +594,7 @@ static BOOL Opera6_GetIniFilePath(TCHAR *szIniFile)
/* path */
mir_free(p);
p=GetRegStrValue(hExeKey,_T("Path"));
- len=lstrlen(p);
+ len=mir_tstrlen(p);
if (p[len-1]==_T('\\')) p[len-1]=0;
fSuccess=(p!=NULL && ExpandEnvironmentStrings(p,szPath,MAX_PATH));
}
@@ -604,15 +604,15 @@ static BOOL Opera6_GetIniFilePath(TCHAR *szIniFile)
if (fSuccess) {
TCHAR szFileBuf[MAX_PATH+34];
/* operadef6.ini */
- lstrcat(lstrcpy(szFileBuf,szPath),_T("\\operadef6.ini")); /* buffer safe */
+ mir_tstrcat(mir_tstrcpy(szFileBuf,szPath),_T("\\operadef6.ini")); /* buffer safe */
/* If enabled Opera will use Windows profiles to store individual user settings */
if (GetPrivateProfileInt(_T("System"),_T("Multi User"),0,szFileBuf)==1) {
p=_tcsrchr(szPath,'\\');
- lstrcpy(szFileBuf,_T("%APPDATA%\\Opera")); /* buffer safe */
- if (p!=NULL) lstrcat(szFileBuf,p); /* buffer safe */
- } else lstrcpy(szFileBuf,szPath);
+ mir_tstrcpy(szFileBuf,_T("%APPDATA%\\Opera")); /* buffer safe */
+ if (p!=NULL) mir_tstrcat(szFileBuf,p); /* buffer safe */
+ } else mir_tstrcpy(szFileBuf,szPath);
/* opera6.ini */
- lstrcat(szFileBuf,_T("\\profile\\opera6.ini")); /* buffer safe */
+ mir_tstrcat(szFileBuf,_T("\\profile\\opera6.ini")); /* buffer safe */
fSuccess=ExpandEnvironmentStrings(szFileBuf,szIniFile,MAX_PATH)!=0;
}
/* check file existstance */
@@ -690,7 +690,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
if (fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
if (fUrlProto) SetRegStrPrefixValue(hClassKey,_T("URL:"),pszTypeDescription);
- else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(lstrlen(pszTypeDescription)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(mir_tstrlen(pszTypeDescription)+1)*sizeof(TCHAR));
/* default icon */
if (pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,_T("DefaultIcon"),pszIconLoc);
/* url protocol */
@@ -718,16 +718,16 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
if ((res=RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
/* verb description */
if (pszVerbDesc==NULL) RegDeleteValue(hVerbKey,NULL);
- else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(lstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(mir_tstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,_T("command"),pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL) {
if (!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(lstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,_T("application"),pszDdeApp);
/* topic */
@@ -922,9 +922,9 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p
}
mir_free(pszPrevClass); /* does NULL check */
/* class name */
- fSuccess=!RegSetValueExA(hExtKey,NULL,0,REG_SZ,(BYTE*)pszClassName,lstrlenA(pszClassName)+1);
+ fSuccess=!RegSetValueExA(hExtKey,NULL,0,REG_SZ,(BYTE*)pszClassName,mir_strlen(pszClassName)+1);
/* mime type e.g. "application/x-icq" */
- if (pszMimeType!=NULL) RegSetValueExA(hExtKey,"Content Type",0,REG_SZ,(BYTE*)pszMimeType,lstrlenA(pszMimeType)+1);
+ if (pszMimeType!=NULL) RegSetValueExA(hExtKey,"Content Type",0,REG_SZ,(BYTE*)pszMimeType,mir_strlen(pszMimeType)+1);
/* perceived type e.g. text (WinXP+) */
if (fIsText) RegSetValueEx(hExtKey,_T("PerceivedType"),0,REG_SZ,(BYTE*)_T("text"),5*sizeof(TCHAR));
RegCloseKey(hExtKey);
@@ -1028,7 +1028,7 @@ BOOL AddRegMimeType(const char *pszMimeType,const char *pszFileExt,const TCHAR *
if (!RegCreateKeyExA(hDbKey,pszMimeType,0,NULL,0,KEY_QUERY_VALUE|KEY_SET_VALUE,NULL,&hTypeKey,NULL)) {
/* file ext */
if (RegQueryValueExA(hTypeKey,"Extension",NULL,NULL,NULL,NULL)) /* only set if not present */
- fSuccess=!RegSetValueExA(hTypeKey,"Extension",0,REG_SZ,(BYTE*)pszFileExt,lstrlenA(pszFileExt)+1);
+ fSuccess=!RegSetValueExA(hTypeKey,"Extension",0,REG_SZ,(BYTE*)pszFileExt,mir_strlen(pszFileExt)+1);
RegCloseKey(hTypeKey);
/* Opera support */
Opera6_AddKnownMimeType(pszMimeType,pszFileExt,pszDescription);
@@ -1086,7 +1086,7 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
/* filename */
if (!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
/* appname */
- RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
/* no open-with flag */
if (fAllowOpenWith) RegDeleteValue(hExeKey,_T("NoOpenWith"));
else RegSetValueEx(hExeKey,_T("NoOpenWith"),0,REG_SZ,NULL,0);
@@ -1099,14 +1099,14 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
/* verb */
if (!RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,_T("command"),pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL)
if (!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(lstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,_T("application"),pszDdeApp);
/* topic */
@@ -1194,7 +1194,7 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c
TCHAR *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if (ptszFileExt!=NULL)
- RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(lstrlen(pszFileDesc)+1)*sizeof(TCHAR));
+ RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(mir_tstrlen(pszFileDesc)+1)*sizeof(TCHAR));
mir_free(ptszFileExt); /* does NULL check */
RegCloseKey(hTypesKey);
}
@@ -1247,7 +1247,7 @@ BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
/* run */
if (!RegCreateKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
- fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(lstrlen(pszRunCmd)+1)*sizeof(TCHAR));
+ fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR));
RegCloseKey(hRunKey);
}
return fSuccess;
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp
index 6d6ba9add4..41cb0548de 100644
--- a/plugins/AssocMgr/src/test.cpp
+++ b/plugins/AssocMgr/src/test.cpp
@@ -225,7 +225,7 @@ static HANDLE hServiceOpenFile;
static void TrimString(char *str)
{
int len,start;
- len=lstrlenA(str);
+ len=mir_strlen(str);
while(str[0]!='\0' && (unsigned char)str[len-1]<=' ') str[--len]=0;
for(start=0;str[start] && (unsigned char)str[start]<=' ';++start);
MoveMemory(str,str+start,len-start+1);
@@ -348,11 +348,11 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam)
sep=strchr(line,'=');
if(sep==NULL) { info.type=0; break; } /* format error */
*(sep++)='\0';
- if (!lstrcmpA("UIN",line)) lstrcpynA(info.uin,sep,sizeof(info.uin)); /* buffer safe */
- else if (!lstrcmpA("Email",line)) lstrcpynA(info.email,sep,sizeof(info.email)); /* buffer safe */
- else if (!lstrcmpA("NickName",line)) lstrcpynA(info.nick,sep,sizeof(info.nick)); /* buffer safe */
- else if (!lstrcmpA("FirstName",line)) lstrcpynA(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
- else if (!lstrcmpA("LastName",line)) lstrcpynA(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
+ if (!lstrcmpA("UIN",line)) mir_strncpy(info.uin,sep,sizeof(info.uin)); /* buffer safe */
+ else if (!lstrcmpA("Email",line)) mir_strncpy(info.email,sep,sizeof(info.email)); /* buffer safe */
+ else if (!lstrcmpA("NickName",line)) mir_strncpy(info.nick,sep,sizeof(info.nick)); /* buffer safe */
+ else if (!lstrcmpA("FirstName",line)) mir_strncpy(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
+ else if (!lstrcmpA("LastName",line)) mir_strncpy(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
}
fclose(fp);
switch(info.type) {
@@ -707,7 +707,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
*/
/* user id */
arg=strchr(jid=arg,'?');
- if(arg==NULL) arg+=lstrlenA(arg); /* points to terminating nul */
+ if(arg==NULL) arg+=mir_strlen(arg); /* points to terminating nul */
else *(arg++)=0;
if (*jid==0) return 1; /* parse failed */
/* send a message to a contact */
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp
index 031ec3b6e9..d1d5dad270 100644
--- a/plugins/AssocMgr/src/utils.cpp
+++ b/plugins/AssocMgr/src/utils.cpp
@@ -118,7 +118,7 @@ BOOL EnumDbPrefixSettings(const char *pszModule,const char *pszSettingPrefix,cha
param.settings=NULL;
param.nSettingsCount=0;
param.pszPrefix=pszSettingPrefix;
- param.nPrefixLen=lstrlenA(pszSettingPrefix);
+ param.nPrefixLen=mir_strlen(pszSettingPrefix);
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
*pnSettingsCount=param.nSettingsCount;
*pSettings=param.settings;
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp
index 1db8bfd406..eeddd928e3 100644
--- a/plugins/AutoRun/src/main.cpp
+++ b/plugins/AutoRun/src/main.cpp
@@ -45,7 +45,7 @@ static void SetAutorun(BOOL autorun)
if ( RegCreateKeyEx(ROOT_KEY, SUB_KEY, 0, NULL, 0, KEY_CREATE_SUB_KEY|KEY_SET_VALUE,NULL,&hKey,&dw) == ERROR_SUCCESS) {
TCHAR result[MAX_PATH];
GetProfilePath(result, SIZEOF(result));
- RegSetValueEx(hKey, _T("MirandaNG"), 0, REG_SZ, (BYTE*)result, sizeof(TCHAR)*lstrlen(result));
+ RegSetValueEx(hKey, _T("MirandaNG"), 0, REG_SZ, (BYTE*)result, sizeof(TCHAR)*mir_tstrlen(result));
RegCloseKey(hKey);
}
break;
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index e406e4a494..b77aba262b 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -455,7 +455,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA
if (hdc != NULL) {
if (dat->hFont != NULL)
hFontPrev = (HFONT)SelectObject(hdc,dat->hFont);
- if (GetTextExtentPoint32(hdc,szOutput,lstrlen(szOutput),&size))
+ if (GetTextExtentPoint32(hdc,szOutput,mir_tstrlen(szOutput),&size))
if (size.cx>=(rc.right-rc.left))
dat->flags&=FWPDF_TIMEISCLIPPED;
if (dat->hFont != NULL)
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index 1ede40e86d..7f1ab8b818 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -483,7 +483,7 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam,LPARAM lParam)
static char szConvBuf[128];
char *buf=u2a(pszDesc);
if (buf==NULL) return 0;
- lstrcpynA(szConvBuf,buf,sizeof(szConvBuf));
+ mir_strncpy(szConvBuf,buf,sizeof(szConvBuf));
mir_free(buf);
return (INT_PTR)szConvBuf;
}
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 75c65dc345..5c537fa06c 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -51,14 +51,14 @@ void TrimString(TCHAR *pszStr)
TCHAR *psz,szChars[]=_T(" \r\n\t");
for(i=0;i<SIZEOF(szChars);++i) {
/* trim end */
- psz=&pszStr[lstrlen(pszStr)-1];
+ psz=&pszStr[mir_tstrlen(pszStr)-1];
while(pszStr[0] && *psz==szChars[i]) {
*psz=0;
psz=CharPrev(pszStr,psz);
}
/* trim beginning */
for(psz=pszStr;(*psz && *psz==szChars[i]);psz=CharNext(psz));
- MoveMemory(pszStr,psz,(lstrlen(psz)+1)*sizeof(TCHAR));
+ MoveMemory(pszStr,psz,(mir_tstrlen(psz)+1)*sizeof(TCHAR));
}
}
@@ -209,12 +209,12 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const
FontIDT fid;
ZeroMemory(&fid,sizeof(fid));
fid.cbSize=sizeof(fid);
- lstrcpynA(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
- lstrcpynA(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
- lstrcpyn(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */
- lstrcpyn(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
- lstrcpyn(fid.backgroundGroup,pszBackgroundGroup,SIZEOF(fid.backgroundGroup)); /* buffer safe */
- lstrcpyn(fid.backgroundName,pszBackgroundName,SIZEOF(fid.backgroundName)); /* buffer safe */
+ mir_strncpy(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
+ mir_strncpy(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
+ mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */
+ mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
+ mir_tstrncpy(fid.backgroundGroup,pszBackgroundGroup,SIZEOF(fid.backgroundGroup)); /* buffer safe */
+ mir_tstrncpy(fid.backgroundName,pszBackgroundName,SIZEOF(fid.backgroundName)); /* buffer safe */
fid.flags=FIDF_ALLOWREREGISTER;
if (bAllowEffects) fid.flags|=FIDF_ALLOWEFFECTS;
fid.order=position;
@@ -227,7 +227,7 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const
if (plfDefault->lfUnderline) fid.deffontsettings.style|=DBFONTF_UNDERLINE;
if (plfDefault->lfStrikeOut) fid.deffontsettings.style|=DBFONTF_STRIKEOUT;
fid.deffontsettings.charset=plfDefault->lfCharSet;
- lstrcpyn(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */
+ mir_tstrncpy(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */
}
FontRegisterT(&fid);
return 0;
@@ -237,8 +237,8 @@ int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLO
{
FontIDT fid;
fid.cbSize=sizeof(fid);
- lstrcpyn(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */
- lstrcpyn(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
+ mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */
+ mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
*pclr=(COLORREF)CallService(MS_FONT_GETT,(WPARAM)&fid,(LPARAM)plf); /* uses fallback font on error */
return (int)*pclr==-1;
}
@@ -249,10 +249,10 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons
ZeroMemory(&cid,sizeof(cid));
cid.cbSize=sizeof(cid);
cid.defcolour=clrDefault;
- lstrcpynA(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
- lstrcpynA(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */
- lstrcpyn(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */
- lstrcpyn(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */
+ mir_strncpy(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
+ mir_strncpy(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */
+ mir_tstrncpy(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */
+ mir_tstrncpy(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */
ColourRegisterT(&cid);
return 0;
}
@@ -262,8 +262,8 @@ int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COL
ColourIDT cid;
ZeroMemory(&cid,sizeof(cid));
cid.cbSize=sizeof(cid);
- lstrcpyn(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
- lstrcpyn(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
+ mir_tstrncpy(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
+ mir_tstrncpy(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
*pclr=(COLORREF)CallService(MS_COLOUR_GETT,(WPARAM)&cid,0);
return (int)*pclr==-1;
}
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index 61686744f4..e95b97f145 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -66,7 +66,7 @@ static void __inline ShutdownAndStopWatcher(void)
static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob)
{
(*ppBlob)[*pcbBlob]=0;
- DWORD cb = lstrlenA((char*)*ppBlob);
+ DWORD cb = mir_strlen((char*)*ppBlob);
/* use Unicode data if present */
if (*pcbBlob>(cb+3)) {
(*ppBlob)[*pcbBlob-1]=0;
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index 2c4f63afd4..997df7b244 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -553,7 +553,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact)
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
- lstrcpyn(file, _tcsrchr(fn, '\\')+1, sizeof(file));
+ mir_tstrncpy(file, _tcsrchr(fn, '\\')+1, sizeof(file));
ofn.lpstrFile = file;
TCHAR *displayName = (TCHAR*) CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR);
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index 77a60eead3..cd3489212b 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -75,7 +75,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam)
{
TCHAR hash[128];
- lstrcpyn(hash, (TCHAR *) lParam, sizeof(hash));
+ mir_tstrncpy(hash, (TCHAR *) lParam, sizeof(hash));
ConvertToFilename(hash, sizeof(hash));
return (INT_PTR) GetCachedAvatar((char *) wParam, hash);
}
@@ -169,13 +169,13 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)
else {
// See if we already have the avatar
TCHAR hash[128];
- lstrcpyn(hash, avatar->hash, sizeof(hash));
+ mir_tstrncpy(hash, avatar->hash, sizeof(hash));
ConvertToFilename(hash, sizeof(hash));
TCHAR *file = GetCachedAvatar(proto, hash);
if (file != NULL) {
- lstrcpyn(history_filename, file, SIZEOF(history_filename));
+ mir_tstrncpy(history_filename, file, SIZEOF(history_filename));
mir_free(file);
}
else {
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp
index 42e2a4c87f..55f3a3ffd2 100644
--- a/plugins/AvatarHistory/src/popup.cpp
+++ b/plugins/AvatarHistory/src/popup.cpp
@@ -105,13 +105,13 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description
((PopupDataType*)ppd.PluginData)->hIcon = ppd.lchIcon;
if (title != NULL)
- lstrcpyn(ppd.lptzContactName, title, SIZEOF(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzContactName, title, SIZEOF(ppd.lptzContactName));
else if (hContact != NULL)
- lstrcpyn(ppd.lptzContactName, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR),
+ mir_tstrncpy(ppd.lptzContactName, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR),
SIZEOF(ppd.lptzContactName));
if (description != NULL)
- lstrcpyn(ppd.lptzText, description, SIZEOF(ppd.lptzText));
+ mir_tstrncpy(ppd.lptzText, description, SIZEOF(ppd.lptzText));
if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
{
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp
index 57e30f163a..2c18e2edea 100644
--- a/plugins/AvatarHistory/src/utils.cpp
+++ b/plugins/AvatarHistory/src/utils.cpp
@@ -86,7 +86,7 @@ int GetUIDFromHContact(MCONTACT contact, TCHAR* uinout, int uinout_len)
cinfo.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&cinfo) == 0) {
if (cinfo.type == CNFT_ASCIIZ) {
- lstrcpyn(uinout, cinfo.pszVal, uinout_len);
+ mir_tstrncpy(uinout, cinfo.pszVal, uinout_len);
// It is up to us to free the string
// The catch? We need to use Miranda's free(), not our CRT's :)
mir_free(cinfo.pszVal);
@@ -101,7 +101,7 @@ int GetUIDFromHContact(MCONTACT contact, TCHAR* uinout, int uinout_len)
else found = false;
if (!found)
- lstrcpyn(uinout, TranslateT("Unknown UIN"), uinout_len);
+ mir_tstrncpy(uinout, TranslateT("Unknown UIN"), uinout_len);
return 0;
}
@@ -217,7 +217,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash)
do
{
- size_t len = lstrlen(finddata.cFileName);
+ size_t len = mir_tstrlen(finddata.cFileName);
if (len > 4
&& (!lstrcmpi(&finddata.cFileName[len-4], _T(".png"))
|| !lstrcmpi(&finddata.cFileName[len-4], _T(".bmp"))
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp
index 2c172d6a79..6d94afb260 100644
--- a/plugins/BASS_interface/src/Main.cpp
+++ b/plugins/BASS_interface/src/Main.cpp
@@ -549,11 +549,11 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
else {
DBVARIANT dbv;
if ( db_get_ts(NULL, ModuleName, OPT_BASSPATH, &dbv)) {
- lstrcpyn(CurrBassPath, VARST( _T("Plugins\\Bass\\bass.dll")), SIZEOF(CurrBassPath));
+ mir_tstrncpy(CurrBassPath, VARST( _T("Plugins\\Bass\\bass.dll")), SIZEOF(CurrBassPath));
db_set_ts(NULL, ModuleName, OPT_BASSPATH, CurrBassPath);
}
else {
- lstrcpy(CurrBassPath, dbv.ptszVal);
+ mir_tstrcpy(CurrBassPath, dbv.ptszVal);
db_free(&dbv);
}
}
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp
index 4b18ae58c3..6fce6f0fb4 100644
--- a/plugins/BasicHistory/src/Scheduler.cpp
+++ b/plugins/BasicHistory/src/Scheduler.cpp
@@ -1248,7 +1248,7 @@ void CreatePath(const TCHAR *szDir)
DWORD dwAttributes;
TCHAR *pszLastBackslash, szTestDir[ MAX_PATH ];
- lstrcpyn( szTestDir, szDir, SIZEOF( szTestDir ));
+ mir_tstrncpy( szTestDir, szDir, SIZEOF( szTestDir ));
if (( dwAttributes = GetFileAttributes( szTestDir )) != INVALID_FILE_ATTRIBUTES && ( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ))
return;
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index 11863ee70b..c2ca03957e 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -270,7 +270,7 @@ static void CreateTrayIcon(bool create)
db_free(&dbVar);
}
else
- lstrcpy(nim.szTip, _T("Miranda NG"));
+ mir_tstrcpy(nim.szTip, _T("Miranda NG"));
nim.cbSize = sizeof(nim);
nim.hWnd = g_hListenWindow;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 091c912a6b..ee86de1094 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -628,17 +628,17 @@ int ModulesLoaded(WPARAM, LPARAM)
missyouactions[0].cbSize = sizeof(POPUPACTION);
missyouactions[0].lchIcon = Skin_GetIcon("disabled_icon");
- lstrcpyA(missyouactions[0].lpzTitle, LPGEN("Disable Miss You"));
+ mir_strcpy(missyouactions[0].lpzTitle, LPGEN("Disable Miss You"));
missyouactions[0].wParam = missyouactions[0].lParam = 1;
hideactions[0].cbSize = sizeof(POPUPACTION);
hideactions[0].lchIcon = Skin_GetIcon("hide_icon");
- lstrcpyA(hideactions[0].lpzTitle, LPGEN("Hide contact"));
+ mir_strcpy(hideactions[0].lpzTitle, LPGEN("Hide contact"));
hideactions[0].wParam = hideactions[0].lParam = 2;
hideactions[1].cbSize = sizeof(POPUPACTION);
hideactions[1].lchIcon = Skin_GetIcon("neverhide_icon");
- lstrcpyA(hideactions[1].lpzTitle, LPGEN("Never hide this contact"));
+ mir_strcpy(hideactions[1].lpzTitle, LPGEN("Never hide this contact"));
hideactions[1].wParam = hideactions[1].lParam = 3;
return 0;
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp
index ff3dc4468e..0b1bc5872f 100644
--- a/plugins/BuddyPounce/src/main.cpp
+++ b/plugins/BuddyPounce/src/main.cpp
@@ -76,7 +76,7 @@ int MsgAck(WPARAM wParam, LPARAM lParam)
dbei.flags = DBEF_UTF | DBEF_SENT;
dbei.szModule = (char*)ack->szModule;
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(pszUtf) + 1;
+ dbei.cbBlob = mir_strlen(pszUtf) + 1;
dbei.pBlob = (PBYTE)(char*)pszUtf;
db_event_add(ack->hContact, &dbei);
}
@@ -219,7 +219,7 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg",&dbv))
{
- TCHAR* newPounce = (TCHAR*)mir_alloc(lstrlen(dbv.ptszVal) + lstrlen(message) + 1);
+ TCHAR* newPounce = (TCHAR*)mir_alloc(mir_tstrlen(dbv.ptszVal) + mir_tstrlen(message) + 1);
if (!newPounce) return 1;
_tcscpy(newPounce, dbv.ptszVal);
_tcscat(newPounce, message);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index 32bc9c85d3..7926bf6af7 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -263,14 +263,14 @@ void importCustomStatuses(CSWindow* csw, int result)
mir_snprintf(bufTitle, 32, "XStatus%dName", i);
if ( !db_get_ts( NULL, protoName, bufTitle, &dbv )) {
- lstrcpy(si->m_tszTitle, dbv.ptszVal);
+ mir_tstrcpy(si->m_tszTitle, dbv.ptszVal);
db_free(&dbv);
}
else si->m_tszTitle[0] = 0;
mir_snprintf(bufMessage, 32, "XStatus%dMsg", i);
if ( !db_get_ts( NULL, protoName, bufMessage, &dbv )) {
- lstrcpy(si->m_tszMessage, dbv.ptszVal);
+ mir_tstrcpy(si->m_tszMessage, dbv.ptszVal);
db_free(&dbv);
}
else si->m_tszMessage[0] = 0;
@@ -392,10 +392,10 @@ BOOL CSWindow::itemPassedFilter( ListItem< StatusItem >* li )
TCHAR filter[MAX_PATH];
GetDlgItemText( m_handle, IDC_FILTER_FIELD, filter, SIZEOF(filter) );
- if ( lstrlen( filter ))
+ if ( mir_tstrlen( filter ))
{
TCHAR title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT];
- lstrcpy( title, li->m_item->m_tszTitle ); lstrcpy( message, li->m_item->m_tszMessage );
+ mir_tstrcpy( title, li->m_item->m_tszTitle ); mir_tstrcpy( message, li->m_item->m_tszMessage );
if ( strpos( _tcslwr( title ), _tcslwr( filter )) == -1 )
if ( strpos( _tcslwr( message ), _tcslwr( filter )) == -1 )
return FALSE;
@@ -580,10 +580,10 @@ void CSAMWindow::checkItemValidity()
cs.ptszName = tszTitle;
cs.wParam = &i;
if ( CallProtoService(pdescr->szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
- lstrcpyn(m_item->m_tszTitle, TranslateTS(tszTitle), SIZEOF(m_item->m_tszTitle));
+ mir_tstrncpy(m_item->m_tszTitle, TranslateTS(tszTitle), SIZEOF(m_item->m_tszTitle));
if ( lstrcmp(m_item->m_tszMessage, tszInputMessage))
- lstrcpy( m_item->m_tszMessage, tszInputMessage), m_bChanged = true;
+ mir_tstrcpy( m_item->m_tszMessage, tszInputMessage), m_bChanged = true;
}
CSListView::CSListView(HWND hwnd, CSWindow* parent)
@@ -754,14 +754,14 @@ void CSItemsList::loadItems(char *protoName)
mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_Item%dTitle", protoName, i);
if ( !getTString(dbSetting, &dbv)) {
- lstrcpy(item->m_tszTitle, dbv.ptszVal);
+ mir_tstrcpy(item->m_tszTitle, dbv.ptszVal);
db_free(&dbv);
}
else item->m_tszTitle[0] = 0;
mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_Item%dMessage", protoName, i);
if ( !getTString(dbSetting, &dbv)) {
- lstrcpy(item->m_tszMessage, dbv.ptszVal);
+ mir_tstrcpy(item->m_tszMessage, dbv.ptszVal);
db_free(&dbv);
}
else item->m_tszMessage[0] = 0;
diff --git a/plugins/CSList/src/cslist.h b/plugins/CSList/src/cslist.h
index b359367fcf..e7ea295437 100644
--- a/plugins/CSList/src/cslist.h
+++ b/plugins/CSList/src/cslist.h
@@ -116,16 +116,16 @@ struct StatusItem // list item structure
StatusItem()
{
m_iIcon = 0;
- lstrcpy(m_tszTitle, _T(""));
- lstrcpy(m_tszMessage, _T(""));
+ mir_tstrcpy(m_tszTitle, _T(""));
+ mir_tstrcpy(m_tszMessage, _T(""));
m_bFavourite = FALSE;
}
StatusItem( const StatusItem& p )
{
m_iIcon = p.m_iIcon;
- lstrcpy( m_tszTitle, p.m_tszTitle );
- lstrcpy( m_tszMessage, p.m_tszMessage );
+ mir_tstrcpy( m_tszTitle, p.m_tszTitle );
+ mir_tstrcpy( m_tszMessage, p.m_tszMessage );
m_bFavourite = p.m_bFavourite;
}
diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.h b/plugins/ClientChangeNotify/src/CommonLibs/CString.h
index 0d81a4f7c3..161977cf28 100644
--- a/plugins/ClientChangeNotify/src/CommonLibs/CString.h
+++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.h
@@ -29,14 +29,14 @@
#include "m_system.h"
#include "m_database.h"
-__inline int My_lstrlen(LPCSTR lpString) {return lstrlenA(lpString);}
-__inline int My_lstrlen(LPCWSTR lpString) {return lstrlenW(lpString);}
+__inline int My_lstrlen(LPCSTR lpString) {return mir_strlen(lpString);}
+__inline int My_lstrlen(LPCWSTR lpString) {return mir_wstrlen(lpString);}
__inline int My_lstrcmp(LPCSTR lpString1, LPCSTR lpString2) {return lstrcmpA(lpString1, lpString2);}
__inline int My_lstrcmp(LPCWSTR lpString1, LPCWSTR lpString2) {return lstrcmpW(lpString1, lpString2);}
__inline LPCSTR My_strstr(LPCSTR lpString1, LPCSTR lpString2) {return strstr(lpString1, lpString2);}
__inline LPWSTR My_strstr(LPCWSTR lpString1, LPCWSTR lpString2) {return (LPWSTR)wcsstr(lpString1, lpString2);}
-__inline LPSTR My_lstrcpy(LPSTR lpString1, LPCSTR lpString2) {return lstrcpyA(lpString1, lpString2);}
-__inline LPWSTR My_lstrcpy(LPWSTR lpString1, LPCWSTR lpString2) {return lstrcpyW(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 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);}
diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h
index 8f3d299073..c6b85e9cf6 100644
--- a/plugins/ClientChangeNotify/src/Misc.h
+++ b/plugins/ClientChangeNotify/src/Misc.h
@@ -26,8 +26,8 @@ __inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = _T(""), bool IsError
{
POPUPDATAT ppd = {0};
ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
- lstrcpy(ppd.lptzContactName, FirstLine);
- lstrcpy(ppd.lptzText, SecondLine);
+ mir_tstrcpy(ppd.lptzContactName, FirstLine);
+ mir_tstrcpy(ppd.lptzText, SecondLine);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000;
ppd.iSeconds = Timeout;
diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp
index 2e041b0765..e4a6a1408d 100644
--- a/plugins/Clist_blind/src/clcpaint.cpp
+++ b/plugins/Clist_blind/src/clcpaint.cpp
@@ -307,14 +307,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight);
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, lstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, mir_tstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
width = textSize.cx;
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]);
if (szCounts[0]) {
GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize);
+ GetTextExtentPoint32A(hdcMem, szCounts, mir_strlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -388,7 +388,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText));
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText));
rc.left = rc.right + 6 + textSize.cx;
rc.right = clRect.right;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
@@ -404,7 +404,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
if (rc.right < rc.left + 4)
rc.right = clRect.right + 1;
else
- TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts));
+ TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, mir_strlen(szCounts));
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
@@ -412,12 +412,12 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
SetHotTrackColour(hdcMem, dat);
rc.right--;
ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText), NULL);
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText), NULL);
}
else
TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace,
y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText));
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText));
if (dat->exStyle & CLS_EX_LINEWITHGROUPS) {
rc.top = y + (dat->rowHeight >> 1);
rc.bottom = rc.top + 2;
@@ -434,13 +434,13 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
rc.right = (clRect.right - clRect.left);
rc.bottom = rc.top;
- DrawText(hdcMem, szText, lstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ DrawText(hdcMem, szText, mir_tstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
}
if (selected) {
if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) {
TCHAR *szText = group->cl.items[group->scanIndex]->szText;
RECT rc;
- int qlen = lstrlen(dat->szQuickSearch);
+ int qlen = mir_tstrlen(dat->szQuickSearch);
SetTextColor(hdcMem, dat->quickSearchColour);
rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp
index d2302364e7..c2e6c53512 100644
--- a/plugins/Clist_blind/src/init.cpp
+++ b/plugins/Clist_blind/src/init.cpp
@@ -185,15 +185,15 @@ TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setti
else if (dbv.type == DBVT_UTF8)
MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, out, (int)len);
else if (dbv.type == DBVT_WCHAR)
- lstrcpyn(out, dbv.pwszVal, (int)len);
+ mir_tstrncpy(out, dbv.pwszVal, (int)len);
else if (def != NULL)
- lstrcpyn(out, def, (int)len);
+ mir_tstrncpy(out, def, (int)len);
db_free(&dbv);
}
else {
if (def != NULL)
- lstrcpyn(out, def, (int)len);
+ mir_tstrncpy(out, def, (int)len);
}
return out;
@@ -262,7 +262,7 @@ TCHAR * ParseText(const TCHAR *text,
const TCHAR **variables, size_t variablesSize,
const TCHAR **data, size_t dataSize)
{
- size_t length = lstrlen(text);
+ size_t length = mir_tstrlen(text);
size_t nextPos = 0;
StringHelper ret = {0};
size_t i;
@@ -294,11 +294,11 @@ TCHAR * ParseText(const TCHAR *text,
// See if can find it
for(j = 0 ; j < size ; j++)
{
- size_t vlen = lstrlen(variables[j]);
+ size_t vlen = mir_tstrlen(variables[j]);
if (_tcsnicmp(&text[i], variables[j], vlen) == 0)
{
- if (CopyData(&ret, data[j], lstrlen(data[j])))
+ if (CopyData(&ret, data[j], mir_tstrlen(data[j])))
return NULL;
i += vlen - 1;
@@ -448,7 +448,7 @@ TCHAR *GetStatusName(struct ClcContact *item)
// Get status name
status = db_get_w(item->hContact, item->proto, "Status", ID_STATUS_OFFLINE);
- lstrcpyn(status_name, pcli->pfnGetStatusModeDescription(status, GSMDF_TCHAR), MAX_REGS(status_name));
+ mir_tstrncpy(status_name, pcli->pfnGetStatusModeDescription(status, GSMDF_TCHAR), MAX_REGS(status_name));
return status_name;
}
@@ -484,7 +484,7 @@ TCHAR *GetProtoName(struct ClcContact *item)
proto_name[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
{
- lstrcpyn(proto_name, TranslateT("Unknown Protocol"), MAX_REGS(proto_name));
+ mir_tstrncpy(proto_name, TranslateT("Unknown Protocol"), MAX_REGS(proto_name));
return proto_name;
}
@@ -501,7 +501,7 @@ TCHAR *GetProtoName(struct ClcContact *item)
return proto_name;
}
- lstrcpyn(proto_name, acc->tszAccountName, MAX_REGS(proto_name));
+ mir_tstrncpy(proto_name, acc->tszAccountName, MAX_REGS(proto_name));
return proto_name;
}
@@ -590,7 +590,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
txt = ParseText(template_group, t, MAX_REGS(t), v, MAX_REGS(v));
if (txt != NULL)
- lstrcpyn(text, txt, (int)size);
+ mir_tstrncpy(text, txt, (int)size);
mir_free(txt);
break;
}
@@ -612,7 +612,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
TCHAR *txt = ParseText(template_contact, t, MAX_REGS(t), v, MAX_REGS(v));
if (txt != NULL)
- lstrcpyn(text, txt, (int)size);
+ mir_tstrncpy(text, txt, (int)size);
mir_free(txt);
break;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 42741e8028..3821131aa1 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -1810,7 +1810,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
};
g_pfwFrames[g_nFramesCount].dwFlags = clfrm->Flags;
- if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->wname) : lstrlenA(clfrm->name)) == 0) {
+ if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
g_pfwFrames[g_nFramesCount].name = (LPTSTR)mir_alloc(255 * sizeof(TCHAR));
GetClassName(g_pfwFrames[g_nFramesCount].hWnd,g_pfwFrames[g_nFramesCount].name,255);
}
@@ -1820,7 +1820,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
}
g_pfwFrames[g_nFramesCount].szName = mir_t2a(g_pfwFrames[g_nFramesCount].name);
if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL
- || ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->TBwname) : lstrlenA(clfrm->TBname)) == 0)
+ || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0)
g_pfwFrames[g_nFramesCount].TitleBar.tbname = mir_tstrdup(g_pfwFrames[g_nFramesCount].name);
else
g_pfwFrames[g_nFramesCount].TitleBar.tbname = (clfrm->Flags&F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname);
@@ -2873,7 +2873,7 @@ int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid)
textrc.left += GetSystemMetrics(SM_CXSMICON)+2;
textrc.top += 2;
}
- ske_TextOut(hdcMem,textrc.left,textrc.top,g_pfwFrames[pos].TitleBar.tbname,lstrlen(g_pfwFrames[pos].TitleBar.tbname));
+ ske_TextOut(hdcMem,textrc.left,textrc.top,g_pfwFrames[pos].TitleBar.tbname,mir_tstrlen(g_pfwFrames[pos].TitleBar.tbname));
}
if (!AlignCOLLIconToLeft)
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index 87fae9df20..7eeb92ba6f 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -298,7 +298,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus
if (!noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = { 0 };
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
- //lstrcpyn(text, dbv.pszVal, text_size);
+ //mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
@@ -366,7 +366,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xsta
if (!noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
// Try to get XStatusMsg
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
- //lstrcpyn(text, dbv.pszVal, text_size);
+ //mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
@@ -378,7 +378,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xsta
// Get StatusMsg
if (pdnce->hContact && text[0] == '\0') {
if (!db_get_ts(pdnce->hContact, "CList", "StatusMsg", &dbv)) {
- //lstrcpyn(text, dbv.pszVal, text_size);
+ //mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
@@ -391,7 +391,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xsta
if (!noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto && text[0] == '\0') {
// Try to get XStatusMsg
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
- //lstrcpyn(text, dbv.pszVal, text_size);
+ //mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
@@ -439,7 +439,7 @@ int Cache_GetLineText(
if (pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
- lstrcpyn(text, dbv.ptszVal, text_size);
+ mir_tstrncpy(text, dbv.ptszVal, text_size);
db_free(&dbv);
CopySkipUnprintableChars(text, text, text_size-1);
}
@@ -493,7 +493,7 @@ int Cache_GetLineText(
case TEXT_TEXT:
{
TCHAR *tmp = variables_parsedup(variable_text, pdnce->tszName, pdnce->hContact);
- lstrcpyn(text, tmp, text_size);
+ mir_tstrncpy(text, tmp, text_size);
mir_free(tmp);
CopySkipUnprintableChars(text, text, text_size-1);
}
@@ -526,19 +526,19 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact)
DBVARIANT dbv = { 0 };
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
TCHAR nick[SIZEOF(contact->szText)];
- lstrcpyn(nick, dbv.ptszVal, SIZEOF(contact->szText));
+ mir_tstrncpy(nick, dbv.ptszVal, SIZEOF(contact->szText));
db_free(&dbv);
// They are the same -> use the name to keep the case
if (_tcsicmp(name, nick) == 0)
- lstrcpyn(contact->szText, name, SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, name, SIZEOF(contact->szText));
else
// Append then
mir_sntprintf(contact->szText, SIZEOF(contact->szText), _T("%s - %s"), name, nick);
}
- else lstrcpyn(contact->szText, name, SIZEOF(contact->szText));
+ else mir_tstrncpy(contact->szText, name, SIZEOF(contact->szText));
}
- else lstrcpyn(contact->szText, name, SIZEOF(contact->szText));
+ else mir_tstrncpy(contact->szText, name, SIZEOF(contact->szText));
if (!dat->force_in_dialog) {
struct SHORTDATA data = { 0 };
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 3dfe676130..696dfde5d3 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -298,7 +298,7 @@ static int clcProceedDragToScroll(HWND hwnd, int Y)
static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR *text, int prefixOk, BOOL fSearchUp)
{
ClcGroup *group = &dat->list;
- int testlen = lstrlen(text);
+ int testlen = mir_tstrlen(text);
BOOL fReturnAsFound = FALSE;
int nLastFound = -1;
if (index == -1) fReturnAsFound = TRUE;
@@ -1595,7 +1595,7 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
return ret;
if (contact) {
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
Cache_GetText(dat, contact, 1);
cliRecalcScrollBar(hwnd, dat);
}
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 9c5ecc6c1e..7b8d3ad64d 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -362,7 +362,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat)
int nHiddenStatus = CLVM_GetContactHiddenStatus(hContact, NULL, dat);
if ((style & CLS_SHOWHIDDEN && nHiddenStatus != -1) || !nHiddenStatus) {
- if (lstrlen(cacheEntry->tszGroup) == 0)
+ if (mir_tstrlen(cacheEntry->tszGroup) == 0)
group = &dat->list;
else
group = cli_AddGroup(hwnd, dat, cacheEntry->tszGroup, (DWORD)-1, 0, 0);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 0c18063a46..032e57fb22 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -1383,7 +1383,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (!db_get_s(NULL, module, "BkBitmap", &dbv)) {
int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if (!retval || retval == CALLSERVICE_NOTFOUND)
- lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
+ mir_strncpy(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
mir_free(dbv.pszVal);
}
else *dat->item[indx].filename = 0;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 689dcca7bc..42d4cfe939 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -209,7 +209,7 @@ void CLCPaint::GetTextSize( SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHA
free_height = text_rc.bottom - text_rc.top;
// Always need cy...
- text_size->cy = ske_DrawText(hdcMem, szText, lstrlen( szText ), &text_rc, DT_CALCRECT | uTextFormat );
+ text_size->cy = ske_DrawText(hdcMem, szText, mir_tstrlen( szText ), &text_rc, DT_CALCRECT | uTextFormat );
text_size->cy = min( text_size->cy, free_height );
if ( plText == NULL )
text_size->cx = min( text_rc.right - text_rc.left + 2, free_width );
@@ -643,7 +643,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcConta
{
TCHAR * b2 = mir_tstrdup( Drawing->szText );
int i, m;
- m = lstrlen( b2 );
+ m = mir_tstrlen( b2 );
for ( i=0; i < m; i++ )
if ( b2[i] == _T( ',' )) b2[i] = _T( '.' );
{
@@ -658,7 +658,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcConta
{
TCHAR * b2 = mir_tstrdup( group->parent->cl.items[0]->szText );
int i, m;
- m = lstrlen( b2 );
+ m = mir_tstrlen( b2 );
for ( i=0; i < m; i++ )
if ( b2[i] == _T( ',' )) b2[i] = _T( '.' );
{
@@ -854,7 +854,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &count_rc, DT_CALCRECT );
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &count_rc, DT_CALCRECT );
count_size.cx += count_rc.right-count_rc.left;
count_size.cy = count_rc.bottom-count_rc.top;
}
@@ -909,11 +909,11 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
else if ( hottrack )
_SetHotTrackColour(hdcMem, dat );
if ( dat->text_rtl != 0 ) _RTLRect( &nameRect, free_row_rc.right, dx );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
if (selected && !dat->filterSearch) {
SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
if ( szCounts && strlen( szCounts )>0 )
{
@@ -923,7 +923,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
else if ( hottrack )
_SetHotTrackColour(hdcMem, dat );
if ( dat->text_rtl != 0 ) _RTLRect( &countRect, free_row_rc.right, dx );
- ske_DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &countRect, uTextFormat );
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &countRect, uTextFormat );
}
{
RECT rc = fr_rc;
@@ -953,7 +953,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
space_size.cy = min( space_rc.bottom - space_rc.top, fr_rc.bottom-fr_rc.top );
ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, DT_CALCRECT );
+ DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &counts_rc, DT_CALCRECT );
counts_size.cx = counts_rc.right - counts_rc.left;
counts_size.cy = min( counts_rc.bottom - counts_rc.top, fr_rc.bottom-fr_rc.top );
@@ -985,7 +985,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
else if ( hottrack )
_SetHotTrackColour(hdcMem, dat );
if ( dat->text_rtl != 0 ) _RTLRect( &text_rect, free_row_rc.right, dx );
- _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, 0, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
if ( ((dat->filterSearch && Drawing->type != CLCIT_GROUP) || selected) && dat->szQuickSearch[0] != '\0' )
{
int idx = 0;
@@ -998,13 +998,13 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
idx = int(p1 - lowered);
}
SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, mir_tstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
if ( Drawing->type == CLCIT_GROUP && szCounts && szCounts[0] && counts_rc.right-counts_rc.left>0 )
{
ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
if ( dat->text_rtl != 0 ) _RTLRect( &counts_rc, free_row_rc.right, dx );
- ske_DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, uTextFormat );
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &counts_rc, uTextFormat );
if ( dat->text_rtl == 0 )
text_rect.right = counts_rc.right;
else
@@ -1075,7 +1075,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
SetTextColor(hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour(hdcMem, dat );
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
if ( (dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0' )
{
int idx = 0;
@@ -1088,7 +1088,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
idx = int(p1 - lowered);
}
SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, mir_tstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
Drawing->pos_rename_rect = p_rect;
{
@@ -1119,7 +1119,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &count_rc, DT_CALCRECT );
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &count_rc, DT_CALCRECT );
count_size.cx += count_rc.right-count_rc.left;
count_size.cy = count_rc.bottom-count_rc.top;
}
@@ -1173,10 +1173,10 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
SetTextColor(hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour(hdcMem, dat );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
if (selected && !dat->filterSearch) {
SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
if ( szCounts && strlen( szCounts )>0 )
{
@@ -1185,7 +1185,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
SetTextColor(hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour(hdcMem, dat );
- ske_DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &countRect, uTextFormat );
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &countRect, uTextFormat );
}
Drawing->pos_rename_rect = p_rect;
Drawing->pos_label = nameRect;
@@ -1219,7 +1219,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL );
uTextFormat = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
if ( Drawing->type == CLCIT_CONTACT )
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, lstrlen( pdnce->szSecondLineText ), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, mir_tstrlen( pdnce->szSecondLineText ), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys );
break;
}
case TC_TEXT3:
@@ -1248,7 +1248,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL );
uTextFormat = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
if ( Drawing->type == CLCIT_CONTACT )
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, lstrlen( pdnce->szThirdLineText ), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, mir_tstrlen( pdnce->szThirdLineText ), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys );
break;
}
case TC_STATUS:
@@ -1572,7 +1572,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
{
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL );
- ske_DrawText(hdcMem, szResult, lstrlen( szResult ), &p_rect, DT_NOPREFIX | DT_SINGLELINE|( dat->text_rtl ? DT_RTLREADING : 0 ));
+ ske_DrawText(hdcMem, szResult, mir_tstrlen( szResult ), &p_rect, DT_NOPREFIX | DT_SINGLELINE|( dat->text_rtl ? DT_RTLREADING : 0 ));
}
break;
}
@@ -2400,7 +2400,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL );
// Get text size
- text_size.cy = ske_DrawText(hdcMem, szResult, lstrlen( szResult ), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE );
+ text_size.cy = ske_DrawText(hdcMem, szResult, mir_tstrlen( szResult ), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE );
text_size.cy = min( text_size.cy, free_row_rc.bottom - free_row_rc.top );
text_size.cx = rc.right - rc.left;
@@ -2525,7 +2525,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
space_size.cy = min( space_rc.bottom - space_rc.top, free_height );
ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- DrawTextA(hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, DT_CALCRECT );
+ DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &counts_rc, DT_CALCRECT );
//Store position
//StoreItemPos( Drawing, CIT_SUBTEXT1, &counts_rc ); // Or not to comment?
@@ -3029,7 +3029,7 @@ void CLCPaint::_DrawContactText( HDC hdcMem, ClcData *dat, ClcContact *Drawing,
ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat );
if (selected && !dat->filterSearch) {
SetTextColor(hdcMem, dat->quickSearchColour );
- ske_DrawText(hdcMem, Drawing->szText, lstrlen( dat->szQuickSearch ), prcItem, uTextFormat );
+ ske_DrawText(hdcMem, Drawing->szText, mir_tstrlen( dat->szQuickSearch ), prcItem, uTextFormat );
}
}
else if ( Drawing->type == CLCIT_CONTACT )
@@ -3052,7 +3052,7 @@ void CLCPaint::_DrawContactText( HDC hdcMem, ClcData *dat, ClcContact *Drawing,
idx = int(p1 - lowered);
}
SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, idx, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, idx, mir_tstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
}
else
@@ -3112,7 +3112,7 @@ void CLCPaint::_DrawContactTime( HDC hdcMem, ClcData *dat, ClcContact *Drawing,
if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) {
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL );
- ske_DrawText(hdcMem, szResult, lstrlen( szResult ), prcItem, DT_NOPREFIX | DT_SINGLELINE );
+ ske_DrawText(hdcMem, szResult, mir_tstrlen( szResult ), prcItem, DT_NOPREFIX | DT_SINGLELINE );
}
}
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 8293adaefc..f23dc89266 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -724,7 +724,7 @@ int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat, BOOL bExpand
int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
{
ClcGroup *group = &dat->list;
- int testlen = lstrlen(text);
+ int testlen = mir_tstrlen(text);
ClcContact *contact = NULL;
int SubCount = 0;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index ade09879b1..560a76244b 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -355,7 +355,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
else {
HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0);
TCHAR *ptszEvents = TranslateT("No Events");
- ske_DrawText(hDC, ptszEvents, lstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
+ ske_DrawText(hDC, ptszEvents, mir_tstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
}
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index fcad83ee28..2fe2157340 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -108,7 +108,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
mi.ptszName = FAVMENUROOTNAME;
else {
TCHAR *str1 = TranslateTS(FAVMENUROOTNAME), *str2 = TranslateTS(rates[bContactRate]);
- int bufsize = (lstrlen(str1) + lstrlen(str2) + 15) * sizeof(TCHAR);
+ int bufsize = (mir_tstrlen(str1) + mir_tstrlen(str2) + 15) * sizeof(TCHAR);
TCHAR *name = (TCHAR *)_alloca(bufsize);
mir_sntprintf(name, bufsize / sizeof(TCHAR), _T("%s (%s)"), str1, str2);
mi.ptszName = name;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index fd01a532de..7ddb44fa42 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -33,21 +33,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_clcpaint.h"
#include "hdr/modern_sync.h"
-struct PROTOTICKS
-{
- ~PROTOTICKS()
- {
- ImageList_Destroy(himlIconList);
- }
-
- ptrA szProto;
- int nIconsCount;
- int nCycleStartTick;
- int nIndex;
- BOOL bTimerCreated;
- BOOL bGlobal;
- HIMAGELIST himlIconList;
-};
+struct PROTOTICKS
+{
+ ~PROTOTICKS()
+ {
+ ImageList_Destroy(himlIconList);
+ }
+
+ ptrA szProto;
+ int nIconsCount;
+ int nCycleStartTick;
+ int nIndex;
+ BOOL bTimerCreated;
+ BOOL bGlobal;
+ HIMAGELIST himlIconList;
+};
static int CompareTicks(const PROTOTICKS *p1, const PROTOTICKS *p2)
{
@@ -701,9 +701,9 @@ void CLUI_ChangeWindowMode()
TCHAR titleText[255] = { 0 };
DBVARIANT dbv;
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
- lstrcpyn(titleText, _T(MIRANDANAME), SIZEOF(titleText));
+ mir_tstrncpy(titleText, _T(MIRANDANAME), SIZEOF(titleText));
else {
- lstrcpyn(titleText, dbv.ptszVal, SIZEOF(titleText));
+ mir_tstrncpy(titleText, dbv.ptszVal, SIZEOF(titleText));
db_free(&dbv);
}
SetWindowText(pcli->hwndContactList, titleText);
@@ -994,7 +994,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx)
}
// third try global
- lstrcpyn(szFullPath, _T("proto_conn.dll"), SIZEOF(szFullPath));
+ mir_tstrncpy(szFullPath, _T("proto_conn.dll"), SIZEOF(szFullPath));
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
@@ -2511,7 +2511,7 @@ LRESULT CLUI::OnMeasureItem(UINT msg, WPARAM wParam, LPARAM lParam)
HDC hdc = GetDC(m_hWnd);
TCHAR *ptszStr = TranslateT("Status");
SIZE textSize;
- GetTextExtentPoint32(hdc, ptszStr, lstrlen(ptszStr), &textSize);
+ GetTextExtentPoint32(hdc, ptszStr, mir_tstrlen(ptszStr), &textSize);
pmis->itemWidth = textSize.cx;
pmis->itemHeight = 0;
ReleaseDC(m_hWnd, hdc);
@@ -2572,7 +2572,7 @@ LRESULT CLUI::OnDrawItem(UINT msg, WPARAM wParam, LPARAM lParam)
mir_snprintf(buf, SIZEOF(buf), "Main,ID=StatusMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False");
SkinDrawGlyph(dis->hDC, &dis->rcItem, &dis->rcItem, buf);
SetTextColor(dis->hDC, (dis->itemState&ODS_SELECTED/*|dis->itemState&ODS_HOTLIGHT*/) ? dat->MenuTextHiColor : dat->MenuTextColor);
- DrawText(dis->hDC, TranslateT("Status"), lstrlen(TranslateT("Status")), &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
+ DrawText(dis->hDC, TranslateT("Status"), mir_tstrlen(TranslateT("Status")), &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
nStatusMenuState = dis->itemState;
}
else {
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index e4166f89e9..9593ac6d99 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -148,7 +148,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
size.cx += count_rc.right-count_rc.left;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdc,szCounts,lstrlenA(szCounts),&count_rc,DT_CALCRECT);
+ ske_DrawTextA(hdc,szCounts,mir_strlen(szCounts),&count_rc,DT_CALCRECT);
size.cx += count_rc.right-count_rc.left;
tmp = max(tmp,count_rc.bottom-count_rc.top);
}
@@ -306,7 +306,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
g_clcPainter.ChangeToFont(hdc,dat,FONTID_CONTACT_TIME,NULL);
// Get text size
- text_size.cy = ske_DrawText(hdc, szResult, lstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ text_size.cy = ske_DrawText(hdc, szResult, mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
DeleteDC(hdc);
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index ba02bcb6df..837610d0bc 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -1868,8 +1868,8 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName)
BITMAP bmpInfo;
{
- int l = lstrlen(tszFileName);
- lstrcpyn(ext, tszFileName+(l-4),5);
+ int l = mir_tstrlen(tszFileName);
+ mir_tstrncpy(ext, tszFileName+(l-4),5);
}
if (!_tcschr(tszFileName,'%') && !PathFileExists(tszFileName))
return NULL;
@@ -2552,7 +2552,7 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect
// Calc len of input string
if (nCount == -1)
- nCount = lstrlen(lpString);
+ nCount = mir_tstrlen(lpString);
// retrieve destination bitmap bits
HBITMAP hDestBitmap = (HBITMAP)GetCurrentObject(hDC, OBJ_BITMAP);
@@ -3669,8 +3669,8 @@ static DWORD ske_HexToARGB(char * Hex)
static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len)
{
- int l1 = lfirst?lstrlen(lfirst):0;
- int l2 = (len?len:(lstrlen(lsecond)+1));
+ int l1 = lfirst?mir_tstrlen(lfirst):0;
+ int l2 = (len?len:(mir_tstrlen(lsecond)+1));
TCHAR *buf = (TCHAR *)mir_alloc((l1+l2+1)*sizeof(TCHAR));
if (lfirst) memmove(buf,lfirst,l1*sizeof(TCHAR));
memmove(buf+l1,lsecond,l2*sizeof(TCHAR));
@@ -3700,7 +3700,7 @@ TCHAR* ske_ReplaceVar(TCHAR *var)
TCHAR *ske_ParseText(TCHAR *stzText)
{
- int len = lstrlen(stzText);
+ int len = mir_tstrlen(stzText);
TCHAR *result = NULL;
int stpos = 0;
int curpos = 0;
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index 804f7bab41..7748eff498 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -506,7 +506,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim
DWORD end = 0;
DWORD CurentCount = 0;
DWORD len;
- while (i < lstrlen(string))
+ while (i < mir_tstrlen(string))
{
if (string[i] == Delim)
{
@@ -520,7 +520,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim
{
if (SkipSpaces)
{ //remove spaces
- while (string[start] == ' ' && (int)start < lstrlen(string))
+ while (string[start] == ' ' && (int)start < mir_tstrlen(string))
start++;
while (i>1 && string[i-1] == ' ' && i>(int)start)
i--;
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index 8922bf04a3..e381ec59e7 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -374,22 +374,22 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
SIZE textSize;
if (p.bShowProtoName) {
- GetTextExtentPoint32(hDC, p.tszProtoHumanName, lstrlen(p.tszProtoHumanName), &textSize);
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, mir_tstrlen(p.tszProtoHumanName), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
if (p.bShowProtoEmails && p.szProtoEMailCount) {
- GetTextExtentPoint32A(hDC, p.szProtoEMailCount, lstrlenA(p.szProtoEMailCount), &textSize);
+ GetTextExtentPoint32A(hDC, p.szProtoEMailCount, mir_strlen(p.szProtoEMailCount), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
if (p.bShowStatusName) {
- GetTextExtentPoint32(hDC, p.tszProtoStatusText, lstrlen(p.tszProtoStatusText), &textSize);
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, mir_tstrlen(p.tszProtoStatusText), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
if ((p.xStatusMode & 8) && p.tszProtoXStatus) {
- GetTextExtentPoint32(hDC, p.tszProtoXStatus, lstrlen(p.tszProtoXStatus), &textSize);
+ GetTextExtentPoint32(hDC, p.tszProtoXStatus, mir_tstrlen(p.tszProtoXStatus), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
@@ -530,10 +530,10 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.tszProtoHumanName, lstrlen(p.tszProtoHumanName), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoHumanName, mir_tstrlen(p.tszProtoHumanName), &rt, 0);
if ((p.bShowProtoEmails && p.szProtoEMailCount != NULL) || p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
- GetTextExtentPoint32(hDC, p.tszProtoHumanName, lstrlen(p.tszProtoHumanName), &textSize);
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, mir_tstrlen(p.tszProtoHumanName), &textSize);
x += textSize.cx + 3;
}
}
@@ -543,9 +543,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawTextA(hDC, p.szProtoEMailCount, lstrlenA(p.szProtoEMailCount), &rt, 0);
+ ske_DrawTextA(hDC, p.szProtoEMailCount, mir_strlen(p.szProtoEMailCount), &rt, 0);
if (p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
- GetTextExtentPoint32A(hDC, p.szProtoEMailCount, lstrlenA(p.szProtoEMailCount), &textSize);
+ GetTextExtentPoint32A(hDC, p.szProtoEMailCount, mir_strlen(p.szProtoEMailCount), &textSize);
x += textSize.cx + 3;
}
}
@@ -555,9 +555,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.tszProtoStatusText, lstrlen(p.tszProtoStatusText), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoStatusText, mir_tstrlen(p.tszProtoStatusText), &rt, 0);
if (((p.xStatusMode & 8) && p.tszProtoXStatus)) {
- GetTextExtentPoint32(hDC, p.tszProtoStatusText, lstrlen(p.tszProtoStatusText), &textSize);
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, mir_tstrlen(p.tszProtoStatusText), &textSize);
x += textSize.cx + 3;
}
}
@@ -566,7 +566,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.tszProtoXStatus, lstrlen(p.tszProtoXStatus), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoXStatus, mir_tstrlen(p.tszProtoXStatus), &rt, 0);
}
p.protoRect = r;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 34fffc42ce..4324fb1a81 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -650,7 +650,7 @@ void DeleteViewMode( char * szName )
db_unset(NULL, CLVM_MODULE, szSetting);
db_unset(NULL, CLVM_MODULE, szName);
- if (!strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode)) {
+ if (!strcmp(g_CluiData.current_viewmode, szName) && mir_strlen(szName) == mir_strlen(g_CluiData.current_viewmode)) {
g_CluiData.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowText(hwndSelector, TranslateT("All contacts"));
@@ -1306,7 +1306,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
if (!onlySelector) {
mir_snprintf(szSetting, 256, "%c%s_PF", 246, Name);
if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
- if (lstrlenA(dbv.pszVal) >= 2) {
+ if (mir_strlen(dbv.pszVal) >= 2) {
strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
g_CluiData.protoFilter[SIZEOF(g_CluiData.protoFilter) - 1] = 0;
g_CluiData.bFilterEffective |= CLVM_FILTER_PROTOS;
@@ -1315,7 +1315,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, Name);
if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) {
- if (lstrlen(dbv.ptszVal) >= 2) {
+ if (mir_tstrlen(dbv.ptszVal) >= 2) {
_tcsncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter));
g_CluiData.groupFilter[SIZEOF(g_CluiData.groupFilter) - 1] = 0;
g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp
index 62fcef06f2..9eca756415 100644
--- a/plugins/Clist_nicer/skineditor/src/main.cpp
+++ b/plugins/Clist_nicer/skineditor/src/main.cpp
@@ -731,7 +731,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
else if (item) {
char *szName = item->szName[0] == '{' ? &item->szName[3] : item->szName;
- TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, szName, lstrlenA(szName));
+ TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, szName, mir_strlen(szName));
}
return TRUE;
}
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index 7efef43e8d..79cf53b26a 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -328,7 +328,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint)
ctl->sLabel.cx = ctl->sLabel.cy = 0;
}
else {
- GetTextExtentPoint32(hdcMem, ctl->szText, lstrlen(ctl->szText), &ctl->sLabel);
+ GetTextExtentPoint32(hdcMem, ctl->szText, mir_tstrlen(ctl->szText), &ctl->sLabel);
if (g_cxsmIcon + ctl->sLabel.cx + 8 > rcClient.right - rcClient.left)
ctl->sLabel.cx = (rcClient.right - rcClient.left) - g_cxsmIcon - 8;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index b75315df51..af499ceab3 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -1772,7 +1772,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM lParam)
Frames[nFramescount].dwFlags = clfrm->Flags;
- if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->wname) : lstrlenA(clfrm->name)) == 0) {
+ if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
TCHAR ptszClassName[256];
GetClassName(Frames[nFramescount].hWnd, ptszClassName, SIZEOF(ptszClassName));
Frames[nFramescount].name = mir_tstrdup(ptszClassName);
@@ -1780,7 +1780,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM lParam)
else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL
- || ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->TBwname) : lstrlenA(clfrm->TBname)) == 0)
+ || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0)
Frames[nFramescount].TitleBar.tbname = mir_tstrdup(Frames[nFramescount].name);
else
Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname);
@@ -2418,11 +2418,11 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid)
if (!AlignCOLLIconToLeft) {
if (Frames[pos].TitleBar.hicon != NULL) {
DrawIconEx(hdcMem, 6 + cfg::dat.bClipBorder, ((TitleBarH >> 1) - 8), Frames[pos].TitleBar.hicon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, lstrlen(Frames[pos].TitleBar.tbname));
+ TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, mir_tstrlen(Frames[pos].TitleBar.tbname));
}
- else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, lstrlen(Frames[pos].TitleBar.tbname));
+ else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, mir_tstrlen(Frames[pos].TitleBar.tbname));
}
- else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, lstrlen(Frames[pos].TitleBar.tbname));
+ else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, mir_tstrlen(Frames[pos].TitleBar.tbname));
if (!AlignCOLLIconToLeft)
DrawIconEx(hdcMem, Frames[pos].TitleBar.wndSize.right - 22, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN) : LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, NULL, DI_NORMAL);
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index 1449b0446f..0f58d631b8 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -161,7 +161,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam)
ReloadExtraInfo(hContact);
if (!(cfg::dat.dwFlags & CLUI_USEMETAICONS) && !__strcmp(szProto, META_PROTO))
- if ((lstrlenA(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 6)) || strstr("Default,ForceSend,Nick", cws->szSetting))
+ if ((mir_strlen(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 6)) || strstr("Default,ForceSend,Nick", cws->szSetting))
pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, hContact, lParam);
}
if (cfg::dat.bMetaEnabled && !__strcmp(cws->szModule, META_PROTO) && !__strcmp(cws->szSetting, "IsSubcontact"))
@@ -420,7 +420,7 @@ LBL_Def:
ClcContact *contact;
if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -504,7 +504,7 @@ LBL_Def:
contact->proto = GetContactProto(wParam);
CallService(MS_CLIST_INVALIDATEDISPLAYNAME, wParam, 0);
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
RTL_DetectAndSet(contact, 0);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index 8442edb661..94de708bef 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -225,7 +225,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
DBVARIANT dbv = {0};
INT_PTR result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
- if ( !result && lstrlen(dbv.ptszVal) > 0)
+ if ( !result && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if ( !szProto)
@@ -233,11 +233,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (szProto) {
if ( !result )
db_free( &dbv );
- if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0)
+ if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 0)
+ else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0)
+ else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -246,8 +246,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if ( !result )
db_free( &dbv );
result = cfg::getTString(hContact, szProto, "XStatusName", &dbv);
- if ( !result && lstrlen(dbv.ptszVal) > 1) {
- int iLen = lstrlen(dbv.ptszVal);
+ if ( !result && mir_tstrlen(dbv.ptszVal) > 1) {
+ int iLen = mir_tstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (iLen + 2) * sizeof(TCHAR));
_tcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
@@ -266,8 +266,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
cst.ptszName = xStatusName;
if ( !CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
TCHAR *szwXstatusName = TranslateTS(xStatusName);
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
- _tcsncpy(p->statusMsg, szwXstatusName, lstrlen(szwXstatusName) + 1);
+ p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
+ _tcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
@@ -276,7 +276,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR));
+ p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR));
for (int i = 0; dbv.ptszVal[i]; i++) {
if (dbv.ptszVal[i] == (TCHAR)0x0d)
continue;
@@ -291,7 +291,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (p->bStatusMsgValid != STATUSMSG_NOTFOUND) {
WORD infoTypeC2[12];
ZeroMemory(infoTypeC2, sizeof(WORD) * 12);
- int iLen = min(lstrlenW(p->statusMsg), 10);
+ int iLen = min(mir_wstrlen(p->statusMsg), 10);
GetStringTypeW(CT_CTYPE2, p->statusMsg, iLen, infoTypeC2);
p->dwCFlags &= ~ECF_RTLSTATUSMSG;
for (int i = 0; i < 10; i++) {
@@ -361,7 +361,7 @@ void RTL_DetectAndSet(ClcContact *contact, MCONTACT hContact)
p = contact->pExtra;
}
if (p) {
- iLen = min(lstrlenW(szText), 10);
+ iLen = min(mir_wstrlen(szText), 10);
GetStringTypeW(CT_CTYPE2, szText, iLen, infoTypeC2);
p->dwCFlags &= ~ECF_RTLNICK;
for (i = 0; i < 10; i++) {
@@ -382,7 +382,7 @@ void RTL_DetectGroupName(ClcContact *group)
group->isRtl = 0;
if (group->szText) {
- iLen = min(lstrlenW(group->szText), 10);
+ iLen = min(mir_wstrlen(group->szText), 10);
GetStringTypeW(CT_CTYPE2, group->szText, iLen, infoTypeC2);
for (i = 0; i < 10; i++) {
if (infoTypeC2[i] == C2_RIGHTTOLEFT) {
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index 40434ce98e..ab0134290a 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -231,7 +231,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc)
else {
HICON hIcon = reinterpret_cast<HICON>(LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0));
TCHAR *ptszNoEvents = TranslateT("No events...");
- DrawText(hDC, ptszNoEvents, lstrlen(ptszNoEvents), rc, DT_VCENTER | DT_SINGLELINE);
+ DrawText(hDC, ptszNoEvents, mir_tstrlen(ptszNoEvents), rc, DT_VCENTER | DT_SINGLELINE);
DrawIconEx(hDC, 4, (rc->bottom + rc->top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
}
@@ -495,7 +495,7 @@ set_bg_l:
}
else if (type == CLCIT_DIVIDER) {
ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
- GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, contact->szText, mir_tstrlen(contact->szText), &textSize);
}
else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST)
ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight);
@@ -510,13 +510,13 @@ set_bg_l:
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
if (type == CLCIT_GROUP) {
- GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, contact->szText, mir_tstrlen(contact->szText), &textSize);
width = textSize.cx;
szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize);
+ GetTextExtentPoint32A(hdcMem, szCounts, mir_strlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -978,7 +978,7 @@ bgskipped:
rc.left = rcContent.left;
rc.right = rc.left - dat->rightMargin + ((clRect->right - rc.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
- TextOut(hdcMem, rc.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, lstrlen(contact->szText));
+ TextOut(hdcMem, rc.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, mir_tstrlen(contact->szText));
rc.left = rc.right + 6 + textSize.cx;
rc.right = clRect->right - dat->rightMargin;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
@@ -1013,7 +1013,7 @@ bgskipped:
if (g_center)
offset = ((rc.right - rc.left) - labelWidth) / 2;
- TextOutA(hdcMem, rc.left + offset + textSize.cx + spaceSize.cx, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts));
+ TextOutA(hdcMem, rc.left + offset + textSize.cx + spaceSize.cx, rc.top + groupCountsFontTopShift, szCounts, mir_strlen(szCounts));
rightLineStart = rc.left + offset + textSize.cx + spaceSize.cx + countsSize.cx + 2;
if (selected && !g_ignoreselforgroups)
@@ -1122,7 +1122,7 @@ bgskipped:
COLORREF oldColor = GetTextColor(hdcMem);
int idOldFont = dat->currentFontID;
ChangeToFont(hdcMem, dat, FONTID_TIMESTAMP, &fHeight);
- GetTextExtentPoint32(hdcMem, szResult, lstrlen(szResult), &szTime);
+ GetTextExtentPoint32(hdcMem, szResult, mir_tstrlen(szResult), &szTime);
verticalfit = (rowHeight - fHeight >= g_cysmIcon+1);
if (av_right) {
@@ -1204,7 +1204,7 @@ nodisplay:
LONG rightIconsTop = rcContent.bottom - g_cysmIcon;
LONG old_right = rcContent.right;
ULONG textCounter = 0;
- ULONG ulLen = lstrlen(szText);
+ ULONG ulLen = mir_tstrlen(szText);
LONG old_bottom = rcContent.bottom;
DWORD i_dtFlags = DT_WORDBREAK | DT_NOPREFIX | dt_2ndrowflags;
dtp.cbSize = sizeof(dtp);
@@ -1230,7 +1230,7 @@ nodisplay:
if (type != CLCIT_DIVIDER) {
TCHAR *szText = contact->szText;
RECT rc;
- int qlen = lstrlen(dat->szQuickSearch);
+ int qlen = mir_tstrlen(dat->szQuickSearch);
if (hPreviousFont)
SelectObject(hdcMem, hPreviousFont);
SetTextColor(hdcMem, dat->quickSearchColour);
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp
index 5b21bcaa72..cbbc46ce79 100644
--- a/plugins/Clist_nicer/src/clcutils.cpp
+++ b/plugins/Clist_nicer/src/clcutils.cpp
@@ -37,7 +37,7 @@ extern void ( *saveRecalcScrollBar )(HWND hwnd, struct ClcData *dat);
static int MY_pathIsAbsolute(const TCHAR *path)
{
- if ( !path || !(lstrlen(path) > 2))
+ if ( !path || !(mir_tstrlen(path) > 2))
return 0;
if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
@@ -48,30 +48,30 @@ static int MY_pathIsAbsolute(const TCHAR *path)
size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut)
{
- if ( !pSrc || !lstrlen(pSrc) || lstrlen(pSrc) > MAX_PATH)
+ if ( !pSrc || !mir_tstrlen(pSrc) || mir_tstrlen(pSrc) > MAX_PATH)
return 0;
if ( !MY_pathIsAbsolute(pSrc)) {
mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc);
- return lstrlen(pOut);
+ return mir_tstrlen(pOut);
}
TCHAR szTmp[MAX_PATH];
mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s"), pSrc);
_tcslwr(szTmp);
if ( _tcsstr(szTmp, cfg::dat.tszProfilePath)) {
- mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(cfg::dat.tszProfilePath) - 1);
+ mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + mir_tstrlen(cfg::dat.tszProfilePath) - 1);
pOut[0]='.';
- return lstrlen(pOut);
+ return mir_tstrlen(pOut);
}
mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc);
- return lstrlen(pOut);
+ return mir_tstrlen(pOut);
}
size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
{
- if ( !pSrc || !lstrlen(pSrc) || lstrlen(pSrc) > MAX_PATH)
+ if ( !pSrc || !mir_tstrlen(pSrc) || mir_tstrlen(pSrc) > MAX_PATH)
return 0;
if (MY_pathIsAbsolute(pSrc)&&pSrc[0]!='.')
@@ -79,7 +79,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
else if (pSrc[0]=='.')
mir_sntprintf(pOut, MAX_PATH, _T("%s\\%s"), cfg::dat.tszProfilePath, pSrc);
- return lstrlen(pOut);
+ return mir_tstrlen(pOut);
}
/*
@@ -149,7 +149,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont));
else
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont));
- GetTextExtentPoint32(hdc, hitcontact->szText, lstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
char *szCounts;
@@ -158,7 +158,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact
GetTextExtentPoint32A(hdc, " ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32A(hdc, szCounts, lstrlenA(szCounts), &textSize);
+ GetTextExtentPoint32A(hdc, szCounts, mir_strlen(szCounts), &textSize);
width += textSize.cx;
}
}
@@ -290,7 +290,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont));
else
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont));
- GetTextExtentPoint32(hdc, hitcontact->szText, lstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
char *szCounts;
@@ -299,7 +299,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c
GetTextExtentPoint32A(hdc, " ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32A(hdc, szCounts, lstrlenA(szCounts), &textSize);
+ GetTextExtentPoint32A(hdc, szCounts, mir_strlen(szCounts), &textSize);
width += textSize.cx;
}
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 1f2530a0b6..6b3f548bf7 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -885,7 +885,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) {
DBVARIANT dbv = {0};
if (!db_get(NULL, "CList", "LastViewMode", &dbv)) {
- if (lstrlenA(dbv.pszVal) > 2) {
+ if (mir_strlen(dbv.pszVal) > 2) {
if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
ApplyViewMode((char *)dbv.pszVal);
}
@@ -1765,22 +1765,22 @@ buttons_done:
TCHAR szName[64];
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (pa) {
- lstrcpyn(szName, pa->tszAccountName, SIZEOF(szName));
+ mir_tstrncpy(szName, pa->tszAccountName, SIZEOF(szName));
szName[SIZEOF(szName) - 1] = 0;
}
else
szName[0] = 0;
- if (lstrlen(szName) < sizeof(szName) - 1)
- lstrcat(szName, _T(" "));
- GetTextExtentPoint32(dis->hDC, szName, lstrlen(szName), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, lstrlen(szName));
+ if (mir_tstrlen(szName) < sizeof(szName) - 1)
+ mir_tstrcat(szName, _T(" "));
+ GetTextExtentPoint32(dis->hDC, szName, mir_tstrlen(szName), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, mir_tstrlen(szName));
x += textSize.cx;
}
if (showOpts & 4) {
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
- GetTextExtentPoint32(dis->hDC, szStatus, lstrlen(szStatus), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, lstrlen(szStatus));
+ GetTextExtentPoint32(dis->hDC, szStatus, mir_tstrlen(szStatus), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, mir_tstrlen(szStatus));
}
}
else if (dis->CtlType == ODT_MENU) {
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index e9140ed75b..d7ed5ed41c 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -140,16 +140,16 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
if (showOpts & 1)
x += 16;
if (showOpts & 2) {
- lstrcpyn( szName, pa->tszAccountName, SIZEOF(szName));
+ mir_tstrncpy( szName, pa->tszAccountName, SIZEOF(szName));
szName[ SIZEOF(szName)-1 ] = 0;
- if (( showOpts & 4 ) && lstrlen(szName) < sizeof(szName)-1 )
- lstrcat( szName, _T(" "));
- GetTextExtentPoint32( hdc, szName, lstrlen(szName), &textSize );
+ if (( showOpts & 4 ) && mir_tstrlen(szName) < sizeof(szName)-1 )
+ mir_tstrcat( szName, _T(" "));
+ GetTextExtentPoint32( hdc, szName, mir_tstrlen(szName), &textSize );
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
TCHAR* modeDescr = pcli->pfnGetStatusModeDescription( CallProtoService(accs[i]->szModuleName,PS_GETSTATUS,0,0 ), 0 );
- GetTextExtentPoint32(hdc, modeDescr, lstrlen(modeDescr), &textSize );
+ GetTextExtentPoint32(hdc, modeDescr, mir_tstrlen(modeDescr), &textSize );
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
partWidths[partCount]=(partCount?partWidths[partCount-1]:cfg::dat.bCLeft)+ x + 2;
@@ -204,7 +204,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
// update the clui button
if ( !db_get(NULL, "CList", "PrimaryStatus", &dbv)) {
- if (dbv.type == DBVT_ASCIIZ && lstrlenA(dbv.pszVal) > 1) {
+ if (dbv.type == DBVT_ASCIIZ && mir_strlen(dbv.pszVal) > 1) {
wStatus = (WORD) CallProtoService(dbv.pszVal, PS_GETSTATUS, 0, 0);
iIcon = IconFromStatusMode(dbv.pszVal, (int) wStatus, 0, &hIcon);
}
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp
index 2034a7d7e5..47f27e5623 100644
--- a/plugins/Clist_nicer/src/config.cpp
+++ b/plugins/Clist_nicer/src/config.cpp
@@ -353,7 +353,7 @@ HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle)
if (_tcslen(sysPathName) + _tcslen(szFilename) >= MAX_PATH)
throw(CRTException("Error while loading system library", szFilename));
- lstrcat(sysPathName, szFilename);
+ mir_tstrcat(sysPathName, szFilename);
if (useGetHandle)
_h = ::GetModuleHandle(sysPathName);
else
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 0c4832ba3e..7344e6e6c6 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -289,10 +289,10 @@ void LoadExtBkSettingsFromDB()
mir_snprintf(p->szDBname, 30, "EXBK_%s", accs[i]->szModuleName);
if (i == 0) {
- lstrcpynA(p->szName, "{-}", 30);
+ mir_strncpy(p->szName, "{-}", 30);
strncat(p->szName, accs[i]->szModuleName, 30);
}
- else lstrcpynA(p->szName, accs[i]->szModuleName, 30);
+ else mir_strncpy(p->szName, accs[i]->szModuleName, 30);
p->statusID = ID_EXTBK_LAST;
arStatusItems.insert(p);
}
@@ -1202,17 +1202,17 @@ void IMG_LoadItems()
szSections[3001] = szSections[3000] = 0;
char *p = szSections;
- while (lstrlenA(p) > 1) {
+ while (mir_strlen(p) > 1) {
if (p[0] == '$' || p[0] == '@')
IMG_ReadItem(p, szFileName);
- p += (lstrlenA(p) + 1);
+ p += (mir_strlen(p) + 1);
}
nextButtonID = IDC_TBFIRSTUID;
p = szSections;
- while (lstrlenA(p) > 1) {
+ while (mir_strlen(p) > 1) {
if (p[0] == '!')
BTN_ReadItem(p, szFileName);
- p += (lstrlenA(p) + 1);
+ p += (mir_strlen(p) + 1);
}
if (pcli && pcli->hwndContactList)
SetButtonStates(pcli->hwndContactList);
@@ -1251,9 +1251,9 @@ void LoadPerContactSkins(TCHAR *tszFileName)
GetPrivateProfileSectionNamesA(szSections, 3000, file);
szSections[3001] = szSections[3000] = 0;
p = szSections;
- while (lstrlenA(p) > 1) {
+ while (mir_strlen(p) > 1) {
if (p[0] == '%') {
- p += (lstrlenA(p) + 1);
+ p += (mir_strlen(p) + 1);
continue;
}
items = reinterpret_cast<StatusItems_t *>(realloc(items, i * sizeof(StatusItems_t)));
@@ -1268,7 +1268,7 @@ void LoadPerContactSkins(TCHAR *tszFileName)
szItem[99] = 0;
//_DebugPopup(0, "Section: %s -> %s", p, szItem);
ReadItem(this_item, szItem, file);
- p += (lstrlenA(p) + 1);
+ p += (mir_strlen(p) + 1);
i++;
}
@@ -1300,7 +1300,7 @@ void LoadPerContactSkins(TCHAR *tszFileName)
int j;
for (j = 0; j < i - 1; j++) {
if (!strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname) &&
- lstrlenA(szProto) == lstrlenA(items[j].szName) && lstrlenA(UIN) == lstrlenA(items[j].szDBname)) {
+ mir_strlen(szProto) == mir_strlen(items[j].szName) && mir_strlen(UIN) == mir_strlen(items[j].szDBname)) {
cfg::writeDword(hContact, "EXTBK", "TEXT", items[j].TEXTCOLOR);
cfg::writeDword(hContact, "EXTBK", "COLOR1", items[j].COLOR);
cfg::writeDword(hContact, "EXTBK", "COLOR2", items[j].COLOR2);
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index 18fda921a4..eebaf61c4f 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -91,7 +91,7 @@ void _DebugTraceW(const wchar_t *fmt, ...)
va_list va;
va_start(va, fmt);
- lstrcpyW(debug, L"CLN: ");
+ mir_wstrcpy(debug, L"CLN: ");
mir_vsnwprintf(&debug[5], ibsize - 10, fmt, va);
OutputDebugStringW(debug);
@@ -106,7 +106,7 @@ void _DebugTraceA(const char *fmt, ...)
va_list va;
va_start(va, fmt);
- lstrcpyA(debug, "CLN: ");
+ mir_strcpy(debug, "CLN: ");
mir_vsnprintf(&debug[5], ibsize - 10, fmt, va);
#ifdef _DEBUG
OutputDebugStringA(debug);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index c4909b02b6..b4a200fc46 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -663,7 +663,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
db_unset(NULL, CLVM_MODULE, szBuf);
- if (!strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) {
+ if (!strcmp(cfg::dat.current_viewmode, szBuf) && mir_strlen(szBuf) == mir_strlen(cfg::dat.current_viewmode)) {
cfg::dat.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowTextA(hwndSelector, Translate("No view mode"));
@@ -693,7 +693,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemTextA(hwndDlg, IDC_NEWVIEMODE, szBuf, SIZEOF(szBuf));
szBuf[255] = 0;
- if (lstrlenA(szBuf) > 2) {
+ if (mir_strlen(szBuf) > 2) {
if (cfg::getDword(CLVM_MODULE, szBuf, -1) != -1)
MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
else {
@@ -1050,7 +1050,7 @@ void ApplyViewMode(const char *name)
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
- if (lstrlenA(dbv.pszVal) >= 2) {
+ if (mir_strlen(dbv.pszVal) >= 2) {
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;
@@ -1059,7 +1059,7 @@ void ApplyViewMode(const char *name)
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
- if (lstrlen(dbv.ptszVal) >= 2) {
+ if (mir_tstrlen(dbv.ptszVal) >= 2) {
_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;
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
index 70f6006372..01f15f3ebd 100644
--- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp
+++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
@@ -624,7 +624,7 @@ INT_PTR GetCaps(WPARAM wParam,LPARAM lParam)
//gives name to protocol module
INT_PTR GetName(WPARAM wParam,LPARAM lParam)
{
- lstrcpynA((char*)lParam,PLUGINNAME,wParam);
+ mir_strncpy((char*)lParam,PLUGINNAME,wParam);
return 0;
}
@@ -794,7 +794,7 @@ void showMsg(TCHAR *pName, DWORD pid,TCHAR *intIp,TCHAR *extIp,int intPort,int e
//99% of the times you'll just copy this line.
//1% of the times you may wish to change the contact's name. I don't know why you should, but you can.
//char * lpzText;
- //The text for the second line. You could even make something like: char lpzText[128]; lstrcpy(lpzText, "Hello world!"); It's your choice.
+ //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
struct CONNECTION *mpd = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
//MessageBox(NULL,"aaa","aaa",1);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp
index 546468bd20..a414d0a6b8 100644
--- a/plugins/ContactsPlus/src/utils.cpp
+++ b/plugins/ContactsPlus/src/utils.cpp
@@ -115,7 +115,7 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact)
void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart)
{
TCHAR newtitle[512];
- lstrcpyn(newtitle, TranslateTS(pszTitleStart), SIZEOF(newtitle));
+ mir_tstrncpy(newtitle, TranslateTS(pszTitleStart), SIZEOF(newtitle));
if (hContact) {
char *szProto = GetContactProto(hContact);
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp
index 803e8baa72..b47ab8ded7 100644
--- a/plugins/CountryFlags/src/ip2country.cpp
+++ b/plugins/CountryFlags/src/ip2country.cpp
@@ -210,19 +210,19 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut)
if (!lstrcmpi(pszCountry,"ANTARCTICA")) continue;
if (!lstrcmpi(pszCountry,"TIMOR-LESTE")) continue;
if (!lstrcmpi(pszCountry,"PALESTINIAN TERRITORY, OCCUPIED"))
- lstrcpy(pszCountry,"ISRAEL");
+ mir_tstrcpy(pszCountry,"ISRAEL");
else if (!lstrcmpi(pszCountry,"UNITED STATES MINOR OUTLYING ISLANDS"))
- lstrcpy(pszCountry,"UNITED STATES");
+ mir_tstrcpy(pszCountry,"UNITED STATES");
else if (!lstrcmpi(pszCountry,"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"))
- lstrcpy(pszCountry,"UNITED KINGDOM");
+ mir_tstrcpy(pszCountry,"UNITED KINGDOM");
else if (!lstrcmpi(pszTwo,"JE")) /* map error */
- lstrcpy(pszCountry,"UNITED KINGDOM");
+ mir_tstrcpy(pszCountry,"UNITED KINGDOM");
else if (!lstrcmpi(pszTwo,"AX")) /* Åland Island belongs to Finland */
- lstrcpy(pszCountry,"FINLAND");
+ mir_tstrcpy(pszCountry,"FINLAND");
else if (!lstrcmpi(pszTwo,"ME"))
- lstrcpy(pszCountry,"MONTENEGRO");
+ mir_tstrcpy(pszCountry,"MONTENEGRO");
else if (!lstrcmpi(pszTwo,"RS") || !lstrcmpi(pszTwo,"CS"))
- lstrcpy(pszCountry,"SERBIA");
+ mir_tstrcpy(pszCountry,"SERBIA");
/* convert */
for(i=0;i<nCountriesCount;i++) {
/* map different writings */
diff --git a/plugins/CryptoPP/src/PGPw/sdk8.cpp b/plugins/CryptoPP/src/PGPw/sdk8.cpp
index 2dec9b07f4..e91f714d6b 100644
--- a/plugins/CryptoPP/src/PGPw/sdk8.cpp
+++ b/plugins/CryptoPP/src/PGPw/sdk8.cpp
@@ -163,7 +163,7 @@ LPSTR __cdecl _pgp_encrypt_keydb(LPCSTR szPlainMsg, PVOID pgpKeyID)
PGPFindKeyByKeyID(pgpKeyDB, RemoteKeyID, &PublicKey);
PGPError err = PGPEncode(pgpContext,
- PGPOInputBuffer(pgpContext, szPlainMsg, lstrlen(szPlainMsg)),
+ PGPOInputBuffer(pgpContext, szPlainMsg, mir_tstrlen(szPlainMsg)),
PGPOArmorOutput(pgpContext, TRUE),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szEncMsg, 16384, &dwEncMsgLen),
PGPOEncryptToKeyDBObj(pgpContext, PublicKey),
@@ -206,7 +206,7 @@ LPSTR __cdecl _pgp_decrypt_keydb(LPCSTR szEncMsg)
}
PGPError err = PGPDecode(pgpContext,
- PGPOInputBuffer(pgpContext, szEncMsg, lstrlen(szEncMsg)),
+ PGPOInputBuffer(pgpContext, szEncMsg, mir_tstrlen(szEncMsg)),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szPlainMsg, 16384, &dwPlainMsgLen),
PGPOKeyDBRef(pgpContext, pgpKeyDB),
PGPOPassphrase(pgpContext, pszPassphrase),
@@ -244,7 +244,7 @@ PGPError _pgp_import_key(PGPKeyDBRef *keyDB, LPCSTR pgpKey)
keyDB,
PGPOInputBuffer( pgpContext,
pgpKey,
- lstrlen(pgpKey) ),
+ mir_tstrlen(pgpKey) ),
PGPOLastOption(pgpContext ));
#endif
}
@@ -278,7 +278,7 @@ LPSTR __cdecl _pgp_encrypt_key(LPCSTR szPlainMsg, LPCSTR pgpKey)
}
PGPError err = PGPEncode(pgpContext,
- PGPOInputBuffer(pgpContext, szPlainMsg, lstrlen(szPlainMsg)),
+ PGPOInputBuffer(pgpContext, szPlainMsg, mir_tstrlen(szPlainMsg)),
PGPOArmorOutput(pgpContext, TRUE),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szEncMsg, 16384, &dwEncMsgLen),
PGPOEncryptToKeyDBObj(pgpContext, PublicKey),
@@ -332,7 +332,7 @@ LPSTR __cdecl _pgp_decrypt_key(LPCSTR szEncMsg, LPCSTR pgpKey)
}
PGPError err = PGPDecode(pgpContext,
- PGPOInputBuffer(pgpContext, szEncMsg, lstrlen(szEncMsg)),
+ PGPOInputBuffer(pgpContext, szEncMsg, mir_tstrlen(szEncMsg)),
PGPOAllocatedOutputBuffer(pgpContext, (LPVOID *)&szPlainMsg, 16384, &dwPlainMsgLen),
PGPOKeyDBRef(pgpContext, PrivateKeyDB),
PGPOPassphrase(pgpContext, pszPassphrase),
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp
index c5455ef4fd..09268d48e4 100644
--- a/plugins/DbChecker/src/selectdb.cpp
+++ b/plugins/DbChecker/src/selectdb.cpp
@@ -77,15 +77,15 @@ void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath)
{
TCHAR szProfileDir[MAX_PATH], szExpandedProfileDir[MAX_PATH], szMirandaBootIni[MAX_PATH];
- lstrcpy(szMirandaBootIni, szMirandaDir);
- lstrcat(szMirandaBootIni, _T("\\mirandaboot.ini"));
+ mir_tstrcpy(szMirandaBootIni, szMirandaDir);
+ mir_tstrcat(szMirandaBootIni, _T("\\mirandaboot.ini"));
GetPrivateProfileString(_T("Database"), _T("ProfileDir"), _T("./Profiles"), szProfileDir, SIZEOF(szProfileDir), szMirandaBootIni);
ExpandEnvironmentStrings(szProfileDir, szExpandedProfileDir, SIZEOF(szExpandedProfileDir));
_tchdir(szMirandaDir);
if (!_tfullpath(szPath, szExpandedProfileDir, cbPath))
- lstrcpyn(szPath, szMirandaDir, cbPath);
- if (szPath[lstrlen(szPath) - 1] == '\\')
- szPath[lstrlen(szPath) - 1] = 0;
+ mir_tstrncpy(szPath, szMirandaDir, cbPath);
+ if (szPath[mir_tstrlen(szPath) - 1] == '\\')
+ szPath[mir_tstrlen(szPath) - 1] = 0;
}
static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir)
@@ -140,8 +140,8 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix)
WIN32_FIND_DATA fd;
TCHAR szSearchPath[MAX_PATH], szFilename[MAX_PATH];
- lstrcpy(szSearchPath, szProfileDir);
- lstrcat(szSearchPath, _T("\\*.*"));
+ mir_tstrcpy(szSearchPath, szProfileDir);
+ mir_tstrcat(szSearchPath, _T("\\*.*"));
hFind = FindFirstFile(szSearchPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
diff --git a/plugins/DbChecker/src/welcome.cpp b/plugins/DbChecker/src/welcome.cpp
index 5958b09444..a929f5f97c 100644
--- a/plugins/DbChecker/src/welcome.cpp
+++ b/plugins/DbChecker/src/welcome.cpp
@@ -42,7 +42,7 @@ INT_PTR CALLBACK WelcomeDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM l
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
LOGFONT TitleLogFont = ncm.lfMessageFont;
TitleLogFont.lfWeight = FW_BOLD;
- lstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold"));
+ mir_tstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold"));
HDC hdc = GetDC(NULL);
INT FontSize = 12;
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index 4e2aa2b3e0..3141423c99 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -43,7 +43,7 @@ int Openfile(char *outputFile, const char *module)
if (!GetSaveFileName(&ofn))
return 0;
- lstrcpy(outputFile,filename);
+ mir_tstrcpy(outputFile,filename);
return 1;
}
@@ -493,7 +493,7 @@ void importSettings(MCONTACT hContact, char *importstring )
case 'r': *pstr='\r'; break;
default: *pstr=pstr[1]; break;
}
- MoveMemory(pstr+1,pstr+2,lstrlenA(pstr+2)+1);
+ MoveMemory(pstr+1,pstr+2,mir_strlen(pstr+2)+1);
}
}
}
@@ -654,14 +654,14 @@ void ImportSettingsFromFileMenuItem(MCONTACT hContact, char* FilePath)
else
{
if(Exists(FilePath))
- lstrcpy(szFileNames, FilePath);
+ mir_tstrcpy(szFileNames, FilePath);
else
- lstrcpy(szFileNames, "");
+ mir_tstrcpy(szFileNames, "");
}
if (!lstrcmp(szFileNames, "") == 0)
{
- if ((DWORD)lstrlenA(szFileNames) < offset)
+ if ((DWORD)mir_strlen(szFileNames) < offset)
{
index += offset;
strncpy(szPath, szFileNames, offset);
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index df5468c285..96d15d638b 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -331,8 +331,8 @@ void popupWatchedVar(MCONTACT hContact,const char* module,const char* setting)
POPUPDATA ppd = { 0 };
ppd.lchContact = (MCONTACT)hContact;
ppd.lchIcon = hIcon;
- lstrcpyn(ppd.lpzContactName, lpzContactName,MAX_CONTACTNAME);
- lstrcpyn(ppd.lpzText, lpzText,MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lpzContactName, lpzContactName,MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lpzText, lpzText,MAX_SECONDLINE);
ppd.colorBack = colorBack;
ppd.colorText = colorText;
ppd.iSeconds = timeout ? timeout : -1;
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index 7627dae3ed..a79d1fb311 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -232,7 +232,7 @@ int Backup(TCHAR* backup_filename)
}
else
{
- lstrcpyn(dest_file, backup_filename, MAX_PATH);
+ mir_tstrncpy(dest_file, backup_filename, MAX_PATH);
if (!_tcscmp(_tcsrchr(backup_filename, _T('.')), _T(".zip")))
bZip = true;
}
@@ -268,7 +268,7 @@ int Backup(TCHAR* backup_filename)
db_set_dw(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0));
if (!options.disable_popups)
{
- size_t dest_file_len = lstrlen(dest_file);
+ size_t dest_file_len = mir_tstrlen(dest_file);
TCHAR *puText;
if (dest_file_len > 50)
{
@@ -276,9 +276,9 @@ int Backup(TCHAR* backup_filename)
puText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (dest_file_len + 2));
for (i = (int)dest_file_len - 1; dest_file[i] != _T('\\'); i--);
- lstrcpyn(puText, dest_file, i + 2);
- lstrcat(puText, _T("\n"));
- lstrcat(puText, dest_file + i + 1);
+ mir_tstrncpy(puText, dest_file, i + 2);
+ mir_tstrcat(puText, _T("\n"));
+ mir_tstrcat(puText, dest_file + i + 1);
}
else
puText = mir_tstrdup(dest_file);
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index 79ea056065..2b684a610a 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -149,8 +149,8 @@ void ShowPopup(TCHAR* ptszText, TCHAR* ptszHeader, TCHAR* ptszPath)
{
POPUPDATAT ppd = {0};
- lstrcpy(ppd.lptzText, ptszText);
- lstrcpy(ppd.lptzContactName, ptszHeader);
+ mir_tstrcpy(ppd.lptzText, ptszText);
+ mir_tstrcpy(ppd.lptzContactName, ptszHeader);
if (ptszPath != NULL)
ppd.PluginData = (void*)mir_tstrdup(ptszPath);
ppd.PluginWindowProc = DlgProcPopup;
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index 9197a82eed..1a5bc9c64c 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -76,7 +76,7 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam)
wchar_t *path = paths[j];
int length = wcsrchr(path, '\\') - path;
ftp->pfts.wszWorkingDir = (wchar_t*)mir_alloc(sizeof(wchar_t) * (length + 1));
- lstrcpyn(ftp->pfts.wszWorkingDir, paths[j], length + 1);
+ mir_tstrncpy(ftp->pfts.wszWorkingDir, paths[j], length + 1);
ftp->pfts.wszWorkingDir[length] = '\0';
}
@@ -212,7 +212,7 @@ INT_PTR CDropbox::SendFileToDropbox(void *obj, WPARAM hContact, LPARAM lParam)
int length = wcsrchr(filePath, '\\') - filePath;
ftp->pfts.wszWorkingDir = (wchar_t*)mir_alloc(sizeof(wchar_t) * (length + 1));
- lstrcpyn(ftp->pfts.wszWorkingDir, filePath, length + 1);
+ mir_tstrncpy(ftp->pfts.wszWorkingDir, filePath, length + 1);
ftp->pfts.wszWorkingDir[length] = '\0';
ftp->pfts.pwszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*) * (ftp->pfts.totalFiles + 1));
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp
index bda23904e2..48cfe368a0 100644
--- a/plugins/FavContacts/src/contact_cache.cpp
+++ b/plugins/FavContacts/src/contact_cache.cpp
@@ -131,8 +131,8 @@ static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info)
bool ret = false;
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci) && (ci.type == CNFT_ASCIIZ) && ci.pszVal) {
- if (*ci.pszVal && (lstrlen(ci.pszVal) < size - 2)) {
- lstrcpy(buf, ci.pszVal);
+ if (*ci.pszVal && (mir_tstrlen(ci.pszVal) < size - 2)) {
+ mir_tstrcpy(buf, ci.pszVal);
ret = true;
}
mir_free(ci.pszVal);
@@ -156,7 +156,7 @@ void CContactCache::TContactInfo::LoadInfo()
for (int i = 0; i < SIZEOF(items); ++i)
if (AppendInfo(p, SIZEOF(info) - (p - info), hContact, items[i]))
- p += lstrlen(p) + 1;
+ p += mir_tstrlen(p) + 1;
*p = 0;
@@ -171,8 +171,8 @@ TCHAR *nb_stristr(TCHAR *str, TCHAR *substr)
TCHAR *str_up = NEWTSTR_ALLOCA(str);
TCHAR *substr_up = NEWTSTR_ALLOCA(substr);
- CharUpperBuff(str_up, lstrlen(str_up));
- CharUpperBuff(substr_up, lstrlen(substr_up));
+ CharUpperBuff(str_up, mir_tstrlen(str_up));
+ CharUpperBuff(substr_up, mir_tstrlen(substr_up));
TCHAR *p = _tcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
@@ -193,7 +193,7 @@ bool CContactCache::filter(int rate, TCHAR *str)
for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) {
if (kbdLayoutActive == kbdLayouts[iLayout])
- lstrcpy(buf, str);
+ mir_tstrcpy(buf, str);
else {
int i;
for (i = 0; str[i]; ++i) {
@@ -204,7 +204,7 @@ bool CContactCache::filter(int rate, TCHAR *str)
buf[i] = 0;
}
- for (TCHAR *p = m_cache[rate]->info; p && *p; p = p + lstrlen(p) + 1)
+ for (TCHAR *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1)
if (nb_stristr(p, buf))
return true;
}
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp
index 3138ff9ba8..6136b41c3f 100644
--- a/plugins/FavContacts/src/menu.cpp
+++ b/plugins/FavContacts/src/menu.cpp
@@ -47,7 +47,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options)
SelectObject(hdc, g_Options.hfntName);
SIZE sz;
- GetTextExtentPoint32(hdc, name, lstrlen(name), &sz);
+ GetTextExtentPoint32(hdc, name, mir_tstrlen(name), &sz);
lpmis->itemHeight = sz.cy + 8;
lpmis->itemWidth = sz.cx + 10;
SelectObject(hdc, hfntSave);
@@ -81,7 +81,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options)
if (!options->bSysColors)
SelectObject(hdc, g_Options.hfntSecond);
- GetTextExtentPoint32(hdc, title, lstrlen(title), &sz);
+ GetTextExtentPoint32(hdc, title, mir_tstrlen(title), &sz);
textWidth = sz.cx;
lpmis->itemHeight += sz.cy + 3;
@@ -92,7 +92,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options)
TCHAR *name = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
if (!options->bSysColors) SelectObject(hdc, g_Options.hfntName);
- GetTextExtentPoint32(hdc, name, lstrlen(name), &sz);
+ GetTextExtentPoint32(hdc, name, mir_tstrlen(name), &sz);
textWidth = max(textWidth, sz.cx);
SelectObject(hdc, hfntSave);
@@ -158,7 +158,7 @@ static BOOL sttDrawItem_Group(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
TCHAR *name = sttGetGroupName(-INT_PTR(lpdis->itemData));
if (!options->bSysColors)
SelectObject(lpdis->hDC, g_Options.hfntName);
- DrawText(lpdis->hDC, name, lstrlen(name), &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_CENTER);
+ DrawText(lpdis->hDC, name, mir_tstrlen(name), &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_CENTER);
SelectObject(lpdis->hDC, hfntSave);
@@ -306,10 +306,10 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
if (!options->bSysColors)
SelectObject(hdcTemp, g_Options.hfntName);
SetTextColor(hdcTemp, clLine1);
- DrawText(hdcTemp, name, lstrlen(name), &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_TOP | DT_LEFT);
+ DrawText(hdcTemp, name, mir_tstrlen(name), &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_TOP | DT_LEFT);
SIZE sz;
- GetTextExtentPoint32(hdcTemp, name, lstrlen(name), &sz);
+ GetTextExtentPoint32(hdcTemp, name, mir_tstrlen(name), &sz);
lpdis->rcItem.top += sz.cy + 3;
}
@@ -324,7 +324,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
if (!options->bSysColors) SelectObject(hdcTemp, g_Options.hfntSecond);
SetTextColor(hdcTemp, clLine2);
- DrawText(hdcTemp, title, lstrlen(title), &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_TOP | DT_LEFT);
+ DrawText(hdcTemp, title, mir_tstrlen(title), &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_TOP | DT_LEFT);
if (bFree) mir_free(title);
}
@@ -390,13 +390,13 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
RemoveMenu((HMENU)lParam, 1, MF_BYPOSITION);
if (LOWORD(wParam) == VK_BACK) {
- if (int l = lstrlen(g_filter))
+ if (int l = mir_tstrlen(g_filter))
g_filter[l - 1] = 0;
}
else if (_istalnum(LOWORD(wParam))) {
- if (lstrlen(g_filter) < SIZEOF(g_filter) - 1) {
+ if (mir_tstrlen(g_filter) < SIZEOF(g_filter) - 1) {
TCHAR s[] = { LOWORD(wParam), 0 };
- lstrcat(g_filter, s);
+ mir_tstrcat(g_filter, s);
}
}
{
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp
index b853dac162..fce6dffea0 100644
--- a/plugins/FavContacts/src/services.cpp
+++ b/plugins/FavContacts/src/services.cpp
@@ -128,27 +128,27 @@ int ProcessReloadFonts(WPARAM wParam, LPARAM lParam)
LOGFONT lf = { 0 };
FontIDT fontid = { sizeof(fontid) };
- lstrcpy(fontid.group, LPGENT("Favorite Contacts"));
- lstrcpy(fontid.name, LPGENT("Contact name"));
+ mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(fontid.name, LPGENT("Contact name"));
g_Options.clLine1 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntName = CreateFontIndirect(&lf);
- lstrcpy(fontid.name, LPGENT("Second line"));
+ mir_tstrcpy(fontid.name, LPGENT("Second line"));
g_Options.clLine2 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntSecond = CreateFontIndirect(&lf);
- lstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
+ mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
- lstrcpy(fontid.name, LPGENT("Selected second line (color)"));
+ mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)"));
g_Options.clLine2Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
ColourIDT colourid = { sizeof(colourid) };
- lstrcpy(colourid.group, LPGENT("Favorite Contacts"));
- lstrcpy(colourid.name, LPGENT("Background"));
+ mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(colourid.name, LPGENT("Background"));
g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
- lstrcpy(colourid.name, LPGENT("Selected background"));
+ mir_tstrcpy(colourid.name, LPGENT("Selected background"));
g_Options.clBackSel = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
return 0;
@@ -171,39 +171,39 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////
FontIDT fontid = { sizeof(fontid) };
- lstrcpy(fontid.group, LPGENT("Favorite Contacts"));
- lstrcpyA(fontid.dbSettingsGroup, "FavContacts");
- lstrcpy(fontid.backgroundGroup, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts"));
+ mir_strcpy(fontid.dbSettingsGroup, "FavContacts");
+ mir_tstrcpy(fontid.backgroundGroup, LPGENT("Favorite Contacts"));
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.size = -11;
- lstrcpy(fontid.deffontsettings.szFace, _T("MS Shell Dlg"));
+ mir_tstrcpy(fontid.deffontsettings.szFace, _T("MS Shell Dlg"));
fontid.deffontsettings.style = 0;
- lstrcpy(fontid.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENT("Background"));
- lstrcpy(fontid.name, LPGENT("Contact name"));
- lstrcpyA(fontid.prefix, "fntName");
+ mir_tstrcpy(fontid.name, LPGENT("Contact name"));
+ mir_strcpy(fontid.prefix, "fntName");
fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- lstrcpy(fontid.name, LPGENT("Second line"));
- lstrcpyA(fontid.prefix, "fntSecond");
+ mir_tstrcpy(fontid.name, LPGENT("Second line"));
+ mir_strcpy(fontid.prefix, "fntSecond");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU));
fontid.deffontsettings.style = 0;
FontRegisterT(&fontid);
- lstrcpy(fontid.backgroundName, LPGENT("Selected background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENT("Selected background"));
- lstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
- lstrcpyA(fontid.prefix, "fntNameSel");
+ mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
+ mir_strcpy(fontid.prefix, "fntNameSel");
fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- lstrcpy(fontid.name, LPGENT("Selected second line (color)"));
- lstrcpyA(fontid.prefix, "fntSecondSel");
+ mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)"));
+ mir_strcpy(fontid.prefix, "fntSecondSel");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT));
fontid.deffontsettings.style = 0;
FontRegisterT(&fontid);
@@ -211,16 +211,16 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////
ColourIDT colourid = { sizeof(colourid) };
- lstrcpy(colourid.group, LPGENT("Favorite Contacts"));
- lstrcpyA(colourid.dbSettingsGroup, "FavContacts");
+ mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts"));
+ mir_strcpy(colourid.dbSettingsGroup, "FavContacts");
- lstrcpy(colourid.name, LPGENT("Background"));
- lstrcpyA(colourid.setting, "BackColour");
+ mir_tstrcpy(colourid.name, LPGENT("Background"));
+ mir_strcpy(colourid.setting, "BackColour");
colourid.defcolour = GetSysColor(COLOR_MENU);
ColourRegisterT(&colourid);
- lstrcpy(colourid.name, LPGENT("Selected background"));
- lstrcpyA(colourid.setting, "SelectedColour");
+ mir_tstrcpy(colourid.name, LPGENT("Selected background"));
+ mir_strcpy(colourid.setting, "SelectedColour");
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index 9ca66fa2a7..5af8b3603d 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -118,13 +118,13 @@ void MakePopupMsg(HWND hDlg, MCONTACT hContact, char *msg)
if(hDlg == hFocused || hDlg == GetParent(hFocused)) return;
//
- //The text for the second line. You could even make something like: char lpzText[128]; lstrcpy(lpzText, "Hello world!"); It's your choice.
+ //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
//
POPUPDATA ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SMALLICON));
- lstrcpy(ppd.lpzContactName, (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, 0));
- lstrcpy(ppd.lpzText, msg);
+ mir_tstrcpy(ppd.lpzContactName, (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, 0));
+ mir_tstrcpy(ppd.lpzText, msg);
ppd.colorBack = GetSysColor(COLOR_INFOBK);
ppd.colorText = GetSysColor(COLOR_INFOTEXT);
ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
@@ -637,7 +637,7 @@ void FILEECHO::onSendTimer()
char prefix[128];
mir_snprintf(prefix, sizeof(prefix), "%X,%X,%X>", chunkIndx+1, chunkPos[chunkIndx], chksum);
#ifdef DEBUG
- overhead += lstrlen((char*)buffer);
+ overhead += mir_tstrlen((char*)buffer);
#endif
sendCmd(0, CMD_DATA, (char*)buffer, (char*)prefix);
chunkAck[chunkIndx] = CHUNK_SENT;
@@ -886,7 +886,7 @@ void CreateDirectoryTree(char *szDir)
DWORD dwAttributes;
char *pszLastBackslash,szTestDir[MAX_PATH];
- lstrcpyn(szTestDir,szDir,sizeof(szTestDir));
+ mir_tstrncpy(szTestDir,szDir,sizeof(szTestDir));
if((dwAttributes=GetFileAttributes(szTestDir))!=0xffffffff
&& dwAttributes&FILE_ATTRIBUTE_DIRECTORY) return;
pszLastBackslash=strrchr(szTestDir,'\\');
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index ed23f8a94c..650ca060c2 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -148,7 +148,7 @@ static void SetSrmmIcon(MCONTACT hContact, LPTSTR ptszMirver)
sid.flags = MBF_TCHAR;
sid.tszTooltip = ptszMirver;
- if ( lstrlen(ptszMirver))
+ if ( mir_tstrlen(ptszMirver))
sid.hIcon = (HICON)ServiceGetClientIconW((WPARAM)ptszMirver, TRUE);
else
sid.flags |= MBF_HIDDEN;
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp
index b6dc796822..05d74ff974 100644
--- a/plugins/FloatingContacts/src/bitmap_funcs.cpp
+++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp
@@ -789,7 +789,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
//slightly modified and integrated to MyBitmap class
void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, lstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, mir_tstrlen(str), &sz);
sz.cx += (blur+2)*2; sz.cy += (blur+2)*2;
x -= blur+2; y -= blur+2;
@@ -819,7 +819,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
SetTextColor(tmp.getDC(), RGB(255,255,255));
SetBkColor(tmp.getDC(), RGB(0,0,0));
ExtTextOutA(tmp.getDC(), 0, 0, ETO_OPAQUE, &rc, "", 0, NULL);
- ::DrawText(tmp.getDC(), str, lstrlen(str), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ ::DrawText(tmp.getDC(), str, mir_tstrlen(str), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
SelectObject(tmp.getDC(), hfnTmp);
GdiFlush();
@@ -997,7 +997,7 @@ bool MyBitmap::loadFromFile_pixel(const char *fn, const char *fnAlpha)
{
allocate(1,1);
int r, g, b, a = 255;
- const char *p = fn + lstrlenA("pixel:");
+ const char *p = fn + mir_strlen("pixel:");
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
@@ -1007,7 +1007,7 @@ bool MyBitmap::loadFromFile_pixel(const char *fn, const char *fnAlpha)
bool MyBitmap::loadFromFile_gradient(const char *fn, const char *fnAlpha)
{
- const char *p = fn + lstrlenA("gradient:");
+ const char *p = fn + mir_strlen("gradient:");
if (*p == 'h') allocate(256,1);
else allocate(1,256);
@@ -1153,11 +1153,11 @@ bool MyBitmap::loadFromFile(const char *fn, const char *fnAlpha)
{
if (bits) free();
- if (!strncmp(fn, "pixel:", lstrlenA("pixel:")))
+ if (!strncmp(fn, "pixel:", mir_strlen("pixel:")))
{
return loadFromFile_pixel(fn, fnAlpha);
} else
- if (!strncmp(fn, "gradient:", lstrlenA("gradient:")))
+ if (!strncmp(fn, "gradient:", mir_strlen("gradient:")))
{
return loadFromFile_gradient(fn, fnAlpha);
} else
diff --git a/plugins/GmailNotifier/src/check.cpp b/plugins/GmailNotifier/src/check.cpp
index b3821cb7cf..6e407a1afd 100644
--- a/plugins/GmailNotifier/src/check.cpp
+++ b/plugins/GmailNotifier/src/check.cpp
@@ -23,23 +23,23 @@ void CheckMailInbox(Account *curAcc)
curAcc->IsChecking = TRUE;
if (!db_get_s(curAcc->hContact, "CList", "MyHandle", &dbv)) {
- lstrcpyA(curAcc->results.content, dbv.pszVal);
+ mir_strcpy(curAcc->results.content, dbv.pszVal);
db_free(&dbv);
}
- else lstrcpyA(curAcc->results.content, curAcc->name);
+ else mir_strcpy(curAcc->results.content, curAcc->name);
tail = strstr(curAcc->results.content, " [");
if (tail) *tail = '\0';
- lstrcatA(curAcc->results.content, " [");
+ mir_strcat(curAcc->results.content, " [");
- lstrcpyA(str, curAcc->results.content);
- lstrcatA(str, Translate("Checking..."));
- lstrcatA(str, "]");
+ mir_strcpy(str, curAcc->results.content);
+ mir_strcat(str, Translate("Checking..."));
+ mir_strcat(str, "]");
db_set_s(curAcc->hContact, "CList", "MyHandle", str);
hHTTPOpen = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, "", "", 0);
if (!hHTTPOpen) {
- lstrcatA(curAcc->results.content, Translate("Can't open Internet!"));
+ mir_strcat(curAcc->results.content, Translate("Can't open Internet!"));
goto error_handle;
}
@@ -54,22 +54,22 @@ void CheckMailInbox(Account *curAcc)
0);
if (!hHTTPConnection) {
- lstrcatA(curAcc->results.content, Translate("Can't reach server!"));
+ mir_strcat(curAcc->results.content, Translate("Can't reach server!"));
goto error_handle;
}
- lstrcpyA(str, "/a/");
- lstrcatA(str, curAcc->hosted);
- lstrcatA(str, "/LoginAction");
+ mir_strcpy(str, "/a/");
+ mir_strcat(str, curAcc->hosted);
+ mir_strcat(str, "/LoginAction");
hHTTPRequest = HttpOpenRequestA(hHTTPConnection, "POST", str, HTTP_VERSIONA, NULL, NULL, INTERNET_FLAG_SECURE, 0);
- lstrcatA(requestBuffer, curAcc->hosted);
- lstrcatA(requestBuffer, "%2Ffeed%2Fatom&service=mail&userName=");
- lstrcatA(requestBuffer, curAcc->name);
+ mir_strcat(requestBuffer, curAcc->hosted);
+ mir_strcat(requestBuffer, "%2Ffeed%2Fatom&service=mail&userName=");
+ mir_strcat(requestBuffer, curAcc->name);
tail = strchr(requestBuffer, '@');
*tail = '\0';
- lstrcatA(requestBuffer, "&password=");
- lstrcatA(requestBuffer, curAcc->pass);
+ mir_strcat(requestBuffer, "&password=");
+ mir_strcat(requestBuffer, curAcc->pass);
if (!HttpSendRequestA(hHTTPRequest, contentType, (int)strlen(contentType) + 1, requestBuffer, (int)strlen(requestBuffer) + 1)) {
- lstrcpyA(curAcc->results.content, Translate("Can't send account data!"));
+ mir_strcpy(curAcc->results.content, Translate("Can't send account data!"));
goto error_handle;
}
@@ -79,40 +79,40 @@ void CheckMailInbox(Account *curAcc)
hHTTPConnection = InternetConnectA(hHTTPOpen, "mail.google.com", INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
if (!hHTTPConnection) {
- lstrcatA(curAcc->results.content, Translate("Can't reach server!"));
+ mir_strcat(curAcc->results.content, Translate("Can't reach server!"));
goto error_handle;
}
if (curAcc->hosted[0]) {
- lstrcpyA(str, "/a/");
- lstrcatA(str, curAcc->hosted);
- lstrcatA(str, "/feed/atom");
+ mir_strcpy(str, "/a/");
+ mir_strcat(str, curAcc->hosted);
+ mir_strcat(str, "/feed/atom");
}
- else lstrcpyA(str, "/mail/feed/atom");
+ else mir_strcpy(str, "/mail/feed/atom");
hHTTPRequest = HttpOpenRequest(hHTTPConnection, _T("GET"), _A2T(str), NULL, NULL, NULL, INTERNET_FLAG_SECURE | INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD, 0);
InternetSetOption(hHTTPRequest, INTERNET_OPTION_USERNAME, _A2T(curAcc->name), (int)strlen(curAcc->name) + 1);
InternetSetOption(hHTTPRequest, INTERNET_OPTION_PASSWORD, _A2T(curAcc->pass), (int)strlen(curAcc->pass) + 1);
if (!HttpSendRequest(hHTTPRequest, NULL, 0, NULL, 0)) {
- lstrcatA(curAcc->results.content, Translate("Can't get RSS feed!"));
+ mir_strcat(curAcc->results.content, Translate("Can't get RSS feed!"));
goto error_handle;
}
while (InternetReadFile(hHTTPRequest, temp, _MAX_DOWN_BUFFER, &bufferLength) && bufferLength > 0) {
temp[bufferLength] = '\0';
- lstrcatA(fileBuffer, temp);
+ mir_strcat(fileBuffer, temp);
}
fileBuffer[_MAX_DOWN_BUFFER - 1] = '\0';
curAcc->results_num = ParsePage(fileBuffer, &curAcc->results);
if (curAcc->results_num == -1) {
- lstrcatA(curAcc->results.content, Translate("Wrong name or password!"));
+ mir_strcat(curAcc->results.content, Translate("Wrong name or password!"));
goto error_handle;
}
InternetCloseHandle(hHTTPOpen);
InternetCloseHandle(hHTTPConnection);
InternetCloseHandle(hHTTPRequest);
- lstrcatA(curAcc->results.content, _itoa(curAcc->results_num, str, 10));
- lstrcatA(curAcc->results.content, "]");
+ mir_strcat(curAcc->results.content, _itoa(curAcc->results_num, str, 10));
+ mir_strcat(curAcc->results.content, "]");
curAcc->IsChecking = FALSE;
return;
@@ -123,7 +123,7 @@ error_handle:
InternetCloseHandle(hHTTPConnection);
InternetCloseHandle(hHTTPRequest);
- lstrcatA(curAcc->results.content, "]");
+ mir_strcat(curAcc->results.content, "]");
curAcc->IsChecking = FALSE;
}
@@ -162,20 +162,20 @@ int ParsePage(char *page, resultLink *prst)
str_head += 7;
str_tail = strstr(str_head, "</title>");
*str_tail = '\0';
- lstrcpynA(title, str_head, 41);
- if (lstrlenA(title) == 40)
- lstrcatA(title, "...");
+ mir_strncpy(title, str_head, 41);
+ if (mir_strlen(title) == 40)
+ mir_strcat(title, "...");
*str_tail = ' ';
str_head = strstr(str_head, "<name>") + 6;
str_tail = strstr(str_head, "</name>");
*str_tail = '\0';
- lstrcpynA(name, str_head, 11);
- lstrcatA(name, ": ");
+ mir_strncpy(name, str_head, 11);
+ mir_strcat(name, ": ");
*str_tail = ' ';
- lstrcpyA(prst->content, name);
- lstrcatA(prst->content, title);
+ mir_strcpy(prst->content, name);
+ mir_strcat(prst->content, title);
MultiByteToWideChar(CP_UTF8, 0, prst->content, -1, str, 64);
WideCharToMultiByte(CP_ACP, 0, str, -1, prst->content, 64, NULL, NULL);
num++;
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp
index 0458dad8b8..992b2cc633 100644
--- a/plugins/GmailNotifier/src/main.cpp
+++ b/plugins/GmailNotifier/src/main.cpp
@@ -51,7 +51,7 @@ INT_PTR GetStatus(WPARAM wParam, LPARAM lParam)
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- lstrcpynA((char*)lParam, pluginName, wParam);
+ mir_strncpy((char*)lParam, pluginName, wParam);
return 0;
}
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp
index a684e5ff0c..cf6cb8b06e 100644
--- a/plugins/GmailNotifier/src/notify.cpp
+++ b/plugins/GmailNotifier/src/notify.cpp
@@ -80,7 +80,7 @@ void NotifyUser(Account *curAcc)
resultLink *prst = curAcc->results.next;
for (int i = 0; i < newMails; i++) {
- dbei.cbBlob = lstrlenA(prst->content) + 1;
+ dbei.cbBlob = mir_strlen(prst->content) + 1;
dbei.pBlob = (PBYTE)prst->content;
db_event_add(curAcc->hContact, &dbei);
prst = prst->next;
@@ -103,7 +103,7 @@ void NotifyUser(Account *curAcc)
ppd.lchContact = curAcc->hContact;
ppd.lchIcon = LoadSkinnedProtoIcon(pluginName, ID_STATUS_OCCUPIED);
- lstrcpyA(ppd.lpzContactName, curAcc->results.content);
+ mir_strcpy(ppd.lpzContactName, curAcc->results.content);
resultLink *prst = curAcc->results.next;
for (int i = 0; i < 5 && i < newMails; i++) {
strcat(ppd.lpzText, prst->content);
@@ -151,12 +151,12 @@ void __cdecl Login_ThreadFunc(void *lpParam)
if (GetBrowser(lpPathBuffer)) {
if (opt.AutoLogin == 0) {
if (curAcc->hosted[0]) {
- lstrcatA(lpPathBuffer, "https://mail.google.com/a/");
- lstrcatA(lpPathBuffer, curAcc->hosted);
- lstrcatA(lpPathBuffer, "/?logout");
+ mir_strcat(lpPathBuffer, "https://mail.google.com/a/");
+ mir_strcat(lpPathBuffer, curAcc->hosted);
+ mir_strcat(lpPathBuffer, "/?logout");
}
else {
- lstrcatA(lpPathBuffer, "https://mail.google.com/mail/?logout");
+ mir_strcat(lpPathBuffer, "https://mail.google.com/mail/?logout");
}
}
else {
@@ -165,29 +165,29 @@ void __cdecl Login_ThreadFunc(void *lpParam)
GetTempFileNameA(buffer, "gmail", 0, szTempName);
hTempFile = CreateFileA(szTempName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- lstrcpyA(buffer, FORMDATA1);
- lstrcatA(buffer, curAcc->hosted);
- lstrcatA(buffer, FORMDATA2);
- lstrcatA(buffer, curAcc->hosted);
- lstrcatA(buffer, FORMDATA3);
- lstrcatA(buffer, "<input type=hidden name=userName value=");
- lstrcatA(buffer, curAcc->name);
+ mir_strcpy(buffer, FORMDATA1);
+ mir_strcat(buffer, curAcc->hosted);
+ mir_strcat(buffer, FORMDATA2);
+ mir_strcat(buffer, curAcc->hosted);
+ mir_strcat(buffer, FORMDATA3);
+ mir_strcat(buffer, "<input type=hidden name=userName value=");
+ mir_strcat(buffer, curAcc->name);
if ((str_temp = strstr(buffer, "@")) != NULL)
*str_temp = '\0';
- lstrcatA(buffer, "><input type=hidden name=password value=");
- lstrcatA(buffer, curAcc->pass);
- lstrcatA(buffer, "></form></body>");
- WriteFile(hTempFile, buffer, lstrlenA(buffer), &dwBytesWritten, NULL);
+ mir_strcat(buffer, "><input type=hidden name=password value=");
+ mir_strcat(buffer, curAcc->pass);
+ mir_strcat(buffer, "></form></body>");
+ WriteFile(hTempFile, buffer, mir_strlen(buffer), &dwBytesWritten, NULL);
CloseHandle(hTempFile);
- lstrcatA(lpPathBuffer, szTempName);
+ mir_strcat(lpPathBuffer, szTempName);
}
else {
- lstrcatA(lpPathBuffer, LINK);
- lstrcatA(lpPathBuffer, mir_urlEncode(curAcc->name));
- lstrcatA(lpPathBuffer, "&Passwd=");
- lstrcatA(lpPathBuffer, mir_urlEncode(curAcc->pass));
+ mir_strcat(lpPathBuffer, LINK);
+ mir_strcat(lpPathBuffer, mir_urlEncode(curAcc->name));
+ mir_strcat(lpPathBuffer, "&Passwd=");
+ mir_strcat(lpPathBuffer, mir_urlEncode(curAcc->pass));
if (opt.AutoLogin == 1)
- lstrcatA(lpPathBuffer, "&PersistentCookie=yes");
+ mir_strcat(lpPathBuffer, "&PersistentCookie=yes");
}
}
}
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp
index 8ac8e51e64..b03a442c96 100644
--- a/plugins/GmailNotifier/src/options.cpp
+++ b/plugins/GmailNotifier/src/options.cpp
@@ -87,7 +87,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
DBVARIANT dbv;
if (!db_get_s(NULL, pluginName, "OpenUsePrgPath", &dbv)) {
- lstrcpyA(str, dbv.pszVal);
+ mir_strcpy(str, dbv.pszVal);
db_free(&dbv);
}
}
@@ -166,7 +166,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (GetDlgItemTextA(hwndDlg, IDC_NAME, acc[curIndex].name, SIZEOF(acc[curIndex].name))) {
tail = strstr(acc[curIndex].name, "@");
if (tail && lstrcmpA(tail + 1, "gmail.com") != 0)
- lstrcpyA(acc[curIndex].hosted, tail + 1);
+ mir_strcpy(acc[curIndex].hosted, tail + 1);
SendMessageA(hwndCombo, CB_DELETESTRING, curIndex, 0);
SendMessageA(hwndCombo, CB_INSERTSTRING, curIndex, (LONG_PTR)acc[curIndex].name);
SendMessageA(hwndCombo, CB_SETCURSEL, curIndex, 0);
diff --git a/plugins/GmailNotifier/src/utility.cpp b/plugins/GmailNotifier/src/utility.cpp
index 9363f27f60..19156366fd 100644
--- a/plugins/GmailNotifier/src/utility.cpp
+++ b/plugins/GmailNotifier/src/utility.cpp
@@ -11,12 +11,12 @@ void BuildList(void)
acc = (Account *)realloc(acc, acc_num * sizeof(Account));
memset(&acc[acc_num-1], 0, sizeof(Account));
acc[acc_num-1].hContact = hContact;
- lstrcpyA(acc[acc_num-1].name, dbv.pszVal);
+ mir_strcpy(acc[acc_num-1].name, dbv.pszVal);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_free(&dbv);
if (!db_get_s(hContact, pluginName, "Password", &dbv)) {
- lstrcpyA(acc[acc_num-1].pass, dbv.pszVal);
+ mir_strcpy(acc[acc_num-1].pass, dbv.pszVal);
db_free(&dbv);
}
}
@@ -25,7 +25,7 @@ void BuildList(void)
for (int i = 0; i < acc_num; i++) {
char *tail = strchr(acc[i].name, '@');
if (tail && lstrcmpA(tail + 1, "gmail.com") != 0)
- lstrcpyA(acc[i].hosted, tail + 1);
+ mir_strcpy(acc[i].hosted, tail + 1);
acc[i].IsChecking = FALSE;
}
}
@@ -43,7 +43,7 @@ BOOL GetBrowser(char *str)
else if (opt.OpenUsePrg == 0)
strKey = strDefault;
else if (!db_get_s(NULL, pluginName, "OpenUsePrgPath", &dbv)) {
- lstrcpyA(str, dbv.pszVal);
+ mir_strcpy(str, dbv.pszVal);
db_free(&dbv);
return FALSE;
}
diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp
index 6b262f8a92..c5b65d489c 100644
--- a/plugins/IEView/src/ChatHTMLBuilder.cpp
+++ b/plugins/IEView/src/ChatHTMLBuilder.cpp
@@ -74,9 +74,9 @@ void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "Font%d", i);
if (db_get(NULL, CHATFONTMOD, str, &dbv))
- lstrcpyA(lf->lfFaceName, "Verdana");
+ mir_strcpy(lf->lfFaceName, "Verdana");
else {
- lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
+ mir_strncpy(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
db_free(&dbv);
}
}
@@ -89,7 +89,7 @@ char *ChatHTMLBuilder::timestampToString(time_t time)
char *pszStamp = "[%H:%M]";
//InitSetting( &g_Settings.pszTimeStamp, "HeaderTime", _T("[%H:%M]"));
strftime(str, 79, pszStamp, localtime(&time));
- lstrcpynA(szResult, ptrA(mir_utf8encode(str)), 500);
+ mir_strncpy(szResult, ptrA(mir_utf8encode(str)), 500);
return szResult;
}
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp
index b0bebbb8f7..d7ecb26fe3 100644
--- a/plugins/IEView/src/HTMLBuilder.cpp
+++ b/plugins/IEView/src/HTMLBuilder.cpp
@@ -374,7 +374,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event)
else if (dbei.eventType == EVENTTYPE_FILE) {
//blob is: sequenceid(DWORD),filename(ASCIIZ),description(ASCIIZ)
char* filename = ((char *)dbei.pBlob) + sizeof(DWORD);
- char* descr = filename + lstrlenA(filename) + 1;
+ char* descr = filename + mir_strlen(filename) + 1;
eventData->ptszText = DbGetEventStringT(&dbei, filename);
if (*descr != '\0')
eventData->ptszText2 = DbGetEventStringT(&dbei, descr);
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp
index 493531e2bc..812b3b5b3d 100644
--- a/plugins/IEView/src/HistoryHTMLBuilder.cpp
+++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp
@@ -90,7 +90,7 @@ char *HistoryHTMLBuilder::timestampToString(DWORD dwFlags, time_t check)
dbtts.szFormat = (char *)"d t";
CallService(MS_DB_TIME_TIMESTAMPTOSTRING, check, (LPARAM) & dbtts);
strncat(szResult, str, 500);
- lstrcpynA(szResult, ptrA(mir_utf8encode(szResult)), 500);
+ mir_strncpy(szResult, ptrA(mir_utf8encode(szResult)), 500);
return szResult;
}
@@ -129,9 +129,9 @@ void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, CO
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "Font.%s.Name", dbSetting);
if (db_get(NULL, HPPMOD, str, &dbv))
- lstrcpyA(lf->lfFaceName, "Verdana");
+ mir_strcpy(lf->lfFaceName, "Verdana");
else {
- lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
+ mir_strncpy(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
db_free(&dbv);
}
}
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp
index d3e910663e..0728738aac 100644
--- a/plugins/IEView/src/MUCCHTMLBuilder.cpp
+++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp
@@ -70,9 +70,9 @@ void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "Font%dFace", i);
if (db_get(NULL, MUCCMOD, str, &dbv))
- lstrcpyA(lf->lfFaceName, "Verdana");
+ mir_strcpy(lf->lfFaceName, "Verdana");
else {
- lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
+ mir_strncpy(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
db_free(&dbv);
}
}
@@ -111,7 +111,7 @@ char *MUCCHTMLBuilder::timestampToString(DWORD dwData, time_t check)
}
CallService(MS_DB_TIME_TIMESTAMPTOSTRING, check, (LPARAM) & dbtts);
strncat(szResult, str, 500);
- lstrcpynA(szResult, ptrA(mir_utf8encode(szResult)), 500);
+ mir_strncpy(szResult, ptrA(mir_utf8encode(szResult)), 500);
return szResult;
}
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp
index f1057dca36..bc42feb127 100644
--- a/plugins/IEView/src/ScriverHTMLBuilder.cpp
+++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp
@@ -112,9 +112,9 @@ void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "SRMFont%d", i);
if (db_get(NULL, SRMMMOD, str, &dbv))
- lstrcpyA(lf->lfFaceName, "Verdana");
+ mir_strcpy(lf->lfFaceName, "Verdana");
else {
- lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
+ mir_strncpy(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
db_free(&dbv);
}
}
@@ -172,7 +172,7 @@ char *ScriverHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mod
//_tcsncat(szResult, str, 500);
strncat(szResult, str, 500);
}
- lstrcpynA(szResult, ptrA(mir_utf8encode(szResult)), 500);
+ mir_strncpy(szResult, ptrA(mir_utf8encode(szResult)), 500);
return szResult;
}
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
index da11d66568..2a87dc18f2 100644
--- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
+++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
@@ -143,9 +143,9 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, SIZEOF(str), "Font%d", i);
if (db_get(NULL, TABSRMM_FONTMODULE, str, &dbv))
- lstrcpyA(lf->lfFaceName, "Verdana");
+ mir_strcpy(lf->lfFaceName, "Verdana");
else {
- lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
+ mir_strncpy(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
db_free(&dbv);
}
}
@@ -195,7 +195,7 @@ char* TabSRMMHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int isG
}
CallService(MS_DB_TIME_TIMESTAMPTOSTRING, check, (LPARAM)& dbtts);
strncat(szResult, str, 500);
- lstrcpynA(szResult, ptrA(mir_utf8encode(szResult)), 500);
+ mir_strncpy(szResult, ptrA(mir_utf8encode(szResult)), 500);
return szResult;
}
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp
index e31a7ed915..0e2e5ce0be 100644
--- a/plugins/IEView/src/TemplateHTMLBuilder.cpp
+++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp
@@ -146,7 +146,7 @@ char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mo
}
}
- lstrcpynA(szResult, ptrA(mir_utf8encodeT(str)), 500);
+ mir_strncpy(szResult, ptrA(mir_utf8encodeT(str)), 500);
return szResult;
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 5258ca89af..9061969c68 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -220,7 +220,7 @@ void RegisterProtocol(char *proto, TCHAR *account)
strncpy(proto_items[id].proto, proto, SIZEOF(proto_items[id].proto));
proto_items[id].proto[SIZEOF(proto_items[id].proto)-1] = 0;
- lstrcpyn(proto_items[id].account, account, SIZEOF(proto_items[id].account));
+ mir_tstrncpy(proto_items[id].account, account, SIZEOF(proto_items[id].account));
proto_items[id].hMenu = NULL;
proto_items[id].old_xstatus = 0;
@@ -240,7 +240,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
{
if (wParam == PRAC_UPGRADED || wParam == PRAC_CHANGED)
{
- lstrcpyn(info->account, proto->tszAccountName, SIZEOF(info->account));
+ mir_tstrncpy(info->account, proto->tszAccountName, SIZEOF(info->account));
TCHAR text[512];
mir_sntprintf(text, SIZEOF(text), TranslateT("Send to %s"), info->account);
diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp
index ff2abd3239..ca44c71f9c 100644
--- a/plugins/ListeningTo/src/players/generic.cpp
+++ b/plugins/ListeningTo/src/players/generic.cpp
@@ -34,7 +34,7 @@ int m_log(const TCHAR *function, const TCHAR *fmt, ...)
mir_sntprintf(text, MAX_REGS(text) - 10, _T("[%08u - %08u] [%s] "),
GetCurrentThreadId(), GetTickCount(), function);
- len = lstrlen(text);
+ len = mir_tstrlen(text);
va_start(va, fmt);
mir_vsntprintf(&text[len], MAX_REGS(text) - len, fmt, va);
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp
index 2ceafbffc6..3549ddc84a 100644
--- a/plugins/LotusNotify/src/LotusNotify.cpp
+++ b/plugins/LotusNotify/src/LotusNotify.cpp
@@ -465,7 +465,7 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID)
//99% of the times you'll just copy this line.
//1% of the times you may wish to change the contact's name. I don't know why you should, but you can.
//char * lpzText;
- //The text for the second line. You could even make something like: char lpzText[128]; lstrcpy(lpzText, "Hello world!"); It's your choice.
+ //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
POPUPATT * mpd = (POPUPATT*)malloc(sizeof(POPUPATT));
ZeroMemory(&ppd, sizeof(ppd)); //This is always a good thing to do.
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index e686eef680..a6708aabca 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -245,9 +245,9 @@ void CopyToClipboard(HWND hwnd,LPSTR pszMsg, LPTSTR ptszMsg)
if (buf == 0)
return;
- hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (lstrlen(buf)+1)*sizeof(TCHAR));
+ hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(buf)+1)*sizeof(TCHAR));
lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- lstrcpy(lptstrCopy, buf);
+ mir_tstrcpy(lptstrCopy, buf);
mir_free(buf);
GlobalUnlock(hglbCopy);
@@ -336,7 +336,7 @@ BOOL MirVerExists(MCONTACT hContact)
return 0;
ptrT msg(db_get_tsa(hContact, szProto, "MirVer"));
- return lstrlen(msg) != 0;
+ return mir_tstrlen(msg) != 0;
}
void getIP(MCONTACT hContact,LPSTR szProto,LPSTR szIP)
diff --git a/plugins/MirOTR/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/MirOTR/src/svcs_proto.cpp
index 9c05208b43..5648e90235 100644
--- a/plugins/MirOTR/MirOTR/src/svcs_proto.cpp
+++ b/plugins/MirOTR/MirOTR/src/svcs_proto.cpp
@@ -67,7 +67,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
ShowError(TranslateT(LANG_ENCRYPTION_ERROR));
/* should not be needed
char t[3] = {0, 0, 0};
- if(ccs->wParam & PREF_UNICODE) { //TODO!! lstrlen(pre->szMessage)+1 ??
+ if(ccs->wParam & PREF_UNICODE) { //TODO!! mir_tstrlen(pre->szMessage)+1 ??
if (strlen(oldmessage)) memcpy(oldmessage, t,3 );
} else {
if (strlen(oldmessage)) memcpy(oldmessage, t, 1);
@@ -300,7 +300,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
/* should not be required ;)
char t[3] = {0, 0, 0};
char t[3] = {0, 0, 0};
- if(pre->flags & PREF_UNICODE) { //TODO!! lstrlen(pre->szMessage)+1 ??
+ if(pre->flags & PREF_UNICODE) { //TODO!! mir_tstrlen(pre->szMessage)+1 ??
if (pre->szMessage && strlen(pre->szMessage)) memcpy(pre->szMessage, t,3 );
} else {
if (pre->szMessage && strlen(pre->szMessage)) memcpy(pre->szMessage, t, 1);
@@ -313,7 +313,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
DWORD flags = pre->flags;
/* if(pre->flags & PREF_UTF) {
oldmessage_utf = newmessage;
- } else if(pre->flags & PREF_UNICODE) { //TODO!! lstrlen(pre->szMessage)+1 ??
+ } else if(pre->flags & PREF_UNICODE) { //TODO!! mir_tstrlen(pre->szMessage)+1 ??
oldmessage_utf = (char*)mir_utf8decodeW(newmessage);
free = true;
} else {
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp
index 4248ae3fff..1e50d9fbc4 100644
--- a/plugins/MirandaG15/src/CAppletManager.cpp
+++ b/plugins/MirandaG15/src/CAppletManager.cpp
@@ -801,7 +801,7 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact,bool bEnable)
HANDLE CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage)
{
tstring strAscii = _A2T(toNarrowString(strMessage).c_str());
- int bufSize = lstrlen(strAscii.c_str())+1;
+ int bufSize = mir_tstrlen(strAscii.c_str())+1;
SMessageJob *pJob = new SMessageJob();
pJob->dwTimestamp = GetTickCount();
pJob->hContact = hContact;
@@ -849,7 +849,7 @@ HANDLE CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage
memcpy(pJob->pcBuffer,szMsgUtf,pJob->iBufferSize);
mir_free(szMsgUtf);
} else {
- bIsUnicode = !IsUnicodeAscii(strMessage.c_str(),lstrlen(strMessage.c_str()));
+ bIsUnicode = !IsUnicodeAscii(strMessage.c_str(),mir_tstrlen(strMessage.c_str()));
if(bIsUnicode) {
pref = PREF_UNICODE;
pJob->iBufferSize = bufSize * (sizeof(TCHAR) + 1);
diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp
index a35feaa0a3..e5809be5bf 100644
--- a/plugins/MirandaG15/src/CConfig.cpp
+++ b/plugins/MirandaG15/src/CConfig.cpp
@@ -346,9 +346,9 @@ void CConfig::LoadFontSettings(int iFont)
mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dName",iFont);
DBVARIANT dbv;
if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv))
- lstrcpy(m_logfont[iFont].lfFaceName,_T("Small Fonts"));
+ mir_tstrcpy(m_logfont[iFont].lfFaceName,_T("Small Fonts"));
else {
- lstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
+ mir_tstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp
index 7240263a79..d1ed4dc48d 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp
@@ -302,7 +302,7 @@ void CLCDGfx::DrawText(int nX, int nY, LPCTSTR sText)
dtp.cbSize = sizeof(DRAWTEXTPARAMS);
RECT rBounds = {nX,nY,GetClipWidth(),GetClipHeight()};
- DrawTextEx(m_hDC,(LPTSTR)sText,lstrlen(sText),&rBounds,(DT_LEFT | DT_NOPREFIX),&dtp);
+ DrawTextEx(m_hDC,(LPTSTR)sText,mir_tstrlen(sText),&rBounds,(DT_LEFT | DT_NOPREFIX),&dtp);
// restores
SetMapMode(m_hDC, nOldMapMode);
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp
index 7ac405b294..0c923acfcb 100644
--- a/plugins/ModernOpt/src/mopt_selector.cpp
+++ b/plugins/ModernOpt/src/mopt_selector.cpp
@@ -47,9 +47,9 @@ static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps
}
char *afn = mir_t2a(fn);
- char *fnpreview = (char *)mir_alloc(lstrlenA(afn) + 10);
- lstrcpyA(fnpreview, afn);
- lstrcatA(fnpreview, ".png");
+ char *fnpreview = (char *)mir_alloc(mir_strlen(afn) + 10);
+ mir_strcpy(fnpreview, afn);
+ mir_strcat(fnpreview, ".png");
HBITMAP hbmPreview = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)fnpreview);
mir_free(afn);
mir_free(fnpreview);
@@ -96,7 +96,7 @@ struct TSkinListItem
path = (TCHAR *)mir_alloc(MAX_PATH * sizeof(TCHAR));
PathToRelativeT(curPath, path);
- int length = lstrlen(curPath)+lstrlen(fn)+2;
+ int length = mir_tstrlen(curPath)+mir_tstrlen(fn)+2;
filename = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
mir_sntprintf(filename, length, _T("%s\\%s"), curPath, fn);
}
@@ -128,7 +128,7 @@ struct TSelectorData
static bool CheckExt(TCHAR *fn, TCHAR *ext, int n)
{
- int l = lstrlen(fn);
+ int l = mir_tstrlen(fn);
return (l > n) && !lstrcmp(fn + l - n, ext);
}
@@ -140,7 +140,7 @@ static void BuildSkinList(HWND hwndList, TCHAR *szExt, int nExtLength = -1, bool
if (TCHAR *p = _tcsrchr(mirPath, _T('\\'))) *p = 0;
SetCurrentDirectory(mirPath);
SendMessage(hwndList, LB_RESETCONTENT, 0, 0);
- nExtLength = lstrlen(szExt);
+ nExtLength = mir_tstrlen(szExt);
SendMessage(hwndList, WM_SETREDRAW, FALSE, 0);
}
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp
index b7e5872860..035db49c93 100644
--- a/plugins/MsgPopup/src/main.cpp
+++ b/plugins/MsgPopup/src/main.cpp
@@ -87,8 +87,8 @@ void popupMessage(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)
ppd.iSeconds = options.Timeout[indx];
ppd.lchIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(iIcon), IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED);
- lstrcpy(ppd.lptzContactName, lpCaption);
- lstrcpy(ppd.lptzText, lpText);
+ mir_tstrcpy(ppd.lptzContactName, lpCaption);
+ mir_tstrcpy(ppd.lptzText, lpText);
PUAddPopupT(&ppd);
if(options.Sound)
MessageBeep(uType);
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp
index 55b8a564d9..85eba40907 100644
--- a/plugins/MyDetails/src/data.cpp
+++ b/plugins/MyDetails/src/data.cpp
@@ -54,8 +54,8 @@ void DeInitProtocolData()
Protocol::Protocol(const char *aName, const TCHAR *descr)
{
- lstrcpynA(name, aName, SIZEOF(name));
- lstrcpyn(description, descr, SIZEOF(description));
+ mir_strncpy(name, aName, SIZEOF(name));
+ mir_tstrncpy(description, descr, SIZEOF(description));
data_changed = true;
@@ -88,7 +88,7 @@ void Protocol::lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen)
{
if (lstrcmp(dest, src) != 0) {
data_changed = true;
- lstrcpyn(dest, src, (DWORD)maxlen);
+ mir_tstrncpy(dest, src, (DWORD)maxlen);
}
}
@@ -485,7 +485,7 @@ void ProtocolArray::SetNicks(const TCHAR *nick)
if (nick == NULL || nick[0] == '\0')
return;
- lstrcpyn(default_nick, nick, SIZEOF(default_nick));
+ mir_tstrncpy(default_nick, nick, SIZEOF(default_nick));
db_set_ts(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
@@ -550,7 +550,7 @@ TCHAR *ProtocolArray::GetDefaultStatusMsg(int status)
TCHAR *tmp = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
if (tmp != NULL) {
- lstrcpyn(default_status_message, tmp, SIZEOF(default_status_message));
+ mir_tstrncpy(default_status_message, tmp, SIZEOF(default_status_message));
mir_free(tmp);
}
@@ -590,7 +590,7 @@ static char *StatusModeToDbSetting(int status, const char *suffix)
case ID_STATUS_IDLE: prefix = "Idl"; break;
default: return NULL;
}
- lstrcpyA(str, prefix);
- lstrcatA(str, suffix);
+ mir_strcpy(str, prefix);
+ mir_strcat(str, suffix);
return str;
}
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp
index 364946146a..c613b35763 100644
--- a/plugins/MyDetails/src/services.cpp
+++ b/plugins/MyDetails/src/services.cpp
@@ -60,7 +60,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
if (foundDefNick)
if (_tcsicmp(protocols->default_nick, nick) != 0)
- lstrcpy(protocols->default_nick, nick);
+ mir_tstrcpy(protocols->default_nick, nick);
}
SetDlgItemText(hwndDlg, IDC_NICKNAME, protocols->default_nick);
@@ -189,7 +189,7 @@ INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam)
char *proto = (char *)wParam;
if (proto == NULL) {
if (protocols->default_nick != NULL)
- lstrcpyn(ret, protocols->default_nick, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
+ mir_tstrncpy(ret, protocols->default_nick, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
else
ret[0] = '\0';
@@ -198,7 +198,7 @@ INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam)
else {
Protocol *protocol = protocols->Get(proto);
if (protocol != NULL) {
- lstrcpyn(ret, protocol->nickname, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
+ mir_tstrncpy(ret, protocol->nickname, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE);
return 0;
}
@@ -268,7 +268,7 @@ INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam)
if (proto == NULL) {
if (protocols->default_avatar_file != NULL)
- lstrcpyn(ret, protocols->default_avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
+ mir_tstrncpy(ret, protocols->default_avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
else
ret[0] = '\0';
@@ -283,7 +283,7 @@ INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam)
protocols->Get(i)->GetAvatar();
if (protocols->Get(i)->avatar_file != NULL)
- lstrcpyn(ret, protocols->Get(i)->avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
+ mir_tstrncpy(ret, protocols->Get(i)->avatar_file, MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE);
else
ret[0] = '\0';
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h
index 0d81a4f7c3..161977cf28 100644
--- a/plugins/NewAwaySysMod/src/CString.h
+++ b/plugins/NewAwaySysMod/src/CString.h
@@ -29,14 +29,14 @@
#include "m_system.h"
#include "m_database.h"
-__inline int My_lstrlen(LPCSTR lpString) {return lstrlenA(lpString);}
-__inline int My_lstrlen(LPCWSTR lpString) {return lstrlenW(lpString);}
+__inline int My_lstrlen(LPCSTR lpString) {return mir_strlen(lpString);}
+__inline int My_lstrlen(LPCWSTR lpString) {return mir_wstrlen(lpString);}
__inline int My_lstrcmp(LPCSTR lpString1, LPCSTR lpString2) {return lstrcmpA(lpString1, lpString2);}
__inline int My_lstrcmp(LPCWSTR lpString1, LPCWSTR lpString2) {return lstrcmpW(lpString1, lpString2);}
__inline LPCSTR My_strstr(LPCSTR lpString1, LPCSTR lpString2) {return strstr(lpString1, lpString2);}
__inline LPWSTR My_strstr(LPCWSTR lpString1, LPCWSTR lpString2) {return (LPWSTR)wcsstr(lpString1, lpString2);}
-__inline LPSTR My_lstrcpy(LPSTR lpString1, LPCSTR lpString2) {return lstrcpyA(lpString1, lpString2);}
-__inline LPWSTR My_lstrcpy(LPWSTR lpString1, LPCWSTR lpString2) {return lstrcpyW(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 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);}
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
index aca2c68830..040b566c94 100644
--- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
+++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
@@ -97,7 +97,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
SIZE size;
TCHAR *szText = (TCHAR*)malloc(Len * sizeof(TCHAR));
GetWindowText(hWnd, szText, Len);
- GetTextExtentPoint32(hdc, szText, lstrlen(szText), &size);
+ GetTextExtentPoint32(hdc, szText, mir_tstrlen(szText), &size);
free(szText);
rcText.right = size.cx;
rcText.bottom = size.cy;
@@ -292,7 +292,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
GetThemeTextExtent(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextT, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
else {
SIZE size;
- GetTextExtentPoint32(hdcMem, szTextT, lstrlen(szTextT), &size);
+ GetTextExtentPoint32(hdcMem, szTextT, mir_tstrlen(szTextT), &size);
rcText.right = size.cx;
rcText.bottom = size.cy;
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp
index 258cdcfccc..6ef034d2f9 100644
--- a/plugins/NewAwaySysMod/src/Notification.cpp
+++ b/plugins/NewAwaySysMod/src/Notification.cpp
@@ -26,8 +26,8 @@ void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine, bool IsErrorMsg, int Timeout)
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
- lstrcpyn(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, SecondLine, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000;
ppd.iSeconds = Timeout;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index 12cd708ddc..8c6e7c8e43 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -369,7 +369,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY
HWND hwndDlg = g_SetAwayMsgPage.GetWnd();
GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, Message.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Message.ReleaseBuffer();
- if (!lstrlen(Message))
+ if (!mir_tstrlen(Message))
Message = NULL; // delete personal message if it's empty
if (CList) {
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 835a05102a..90d12c5816 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -387,11 +387,11 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
else commentFix = POPUP_COMMENT_OTHER;
}
- if ( lstrlen(comment1) > 0) {
+ if ( mir_tstrlen(comment1) > 0) {
mir_free(comment2);
return comment1;
}
- if ( lstrlen(comment2) > 0) {
+ if ( mir_tstrlen(comment2) > 0) {
mir_free(comment1);
return comment2;
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index ad821778ba..9a3d42a52f 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -189,7 +189,7 @@ TCHAR *GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
TCHAR *str = (TCHAR *)mir_alloc(2048 * sizeof(TCHAR));
str[0] = _T('\0');
- int len = lstrlen(tmplt);
+ int len = mir_tstrlen(tmplt);
for (int i = 0; i < len; i++) {
tmp[0] = _T('\0');
@@ -199,37 +199,37 @@ TCHAR *GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
switch (tmplt[i]) {
case 'n':
if (n->compare == COMPARE_DEL || _tcscmp(n->newstatusmsg, TranslateT("<no status message>")) == 0)
- lstrcpyn(tmp, TranslateT("<no status message>"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("<no status message>"), SIZEOF(tmp));
else {
TCHAR *_tmp = AddCR(n->newstatusmsg);
- lstrcpyn(tmp, _tmp, SIZEOF(tmp));
+ mir_tstrncpy(tmp, _tmp, SIZEOF(tmp));
mir_free(_tmp);
}
break;
case 'o':
if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == _T('\0') || _tcscmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
- lstrcpyn(tmp, TranslateT("<no status message>"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("<no status message>"), SIZEOF(tmp));
else {
TCHAR *_tmp = AddCR(n->oldstatusmsg);
- lstrcpyn(tmp, _tmp, SIZEOF(tmp));
+ mir_tstrncpy(tmp, _tmp, SIZEOF(tmp));
mir_free(_tmp);
}
break;
case 'c':
if (n->hContact == NULL)
- lstrcpyn(tmp, TranslateT("Contact"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("Contact"), SIZEOF(tmp));
else
- lstrcpyn(tmp, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)n->hContact, GCDNF_TCHAR), SIZEOF(tmp));
+ mir_tstrncpy(tmp, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)n->hContact, GCDNF_TCHAR), SIZEOF(tmp));
break;
case 's':
if (n->hContact == NULL)
- lstrcpyn(tmp, TranslateT("<unknown>"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("<unknown>"), SIZEOF(tmp));
else
- lstrcpyn(tmp, StatusList[Index(db_get_w(n->hContact, n->proto, "Status", ID_STATUS_ONLINE))].lpzStandardText, SIZEOF(tmp));
+ mir_tstrncpy(tmp, StatusList[Index(db_get_w(n->hContact, n->proto, "Status", ID_STATUS_ONLINE))].lpzStandardText, SIZEOF(tmp));
break;
default:
@@ -256,10 +256,10 @@ TCHAR *GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
else tmp[0] = tmplt[i], tmp[1] = _T('\0');
if (tmp[0] != _T('\0')) {
- if (lstrlen(tmp) + lstrlen(str) < 2044)
- lstrcat(str, tmp);
+ if (mir_tstrlen(tmp) + mir_tstrlen(str) < 2044)
+ mir_tstrcat(str, tmp);
else {
- lstrcat(str, _T("..."));
+ mir_tstrcat(str, _T("..."));
break;
}
}
@@ -872,121 +872,121 @@ void InitStatusList()
int index = 0;
//Online
index = Index(ID_STATUS_ONLINE);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) is back online!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) is back online!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) is back online!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Online"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserOnline", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Online"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("global.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) is back online!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) is back online!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is back online!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Online"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnline", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Online"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("global.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40072bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40072tx", COLOR_TX_DEFAULT);
//Offline
index = Index(ID_STATUS_OFFLINE);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) went offline! :("), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) went offline! :("), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) went offline! :("), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Offline"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserOffline", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Offline"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("offline.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) went offline! :("), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) went offline! :("), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went offline! :("), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Offline"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOffline", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Offline"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("offline.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40071bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40071tx", COLOR_TX_DEFAULT);
//Invisible
index = Index(ID_STATUS_INVISIBLE);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) hides in shadows..."), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) hides in shadows..."), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) hides in shadows..."), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Invisible"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserInvisible", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Invisible"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("invisible.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) hides in shadows..."), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) hides in shadows..."), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) hides in shadows..."), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Invisible"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserInvisible", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Invisible"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("invisible.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40078bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40078tx", COLOR_TX_DEFAULT);
//Free for chat
index = Index(ID_STATUS_FREECHAT);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) feels talkative!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) feels talkative!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) feels talkative!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Free for chat"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserFreeForChat", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Free for chat"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("free4chat.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) feels talkative!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) feels talkative!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) feels talkative!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Free for chat"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserFreeForChat", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Free for chat"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("free4chat.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40077bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40077tx", COLOR_TX_DEFAULT);
//Away
index = Index(ID_STATUS_AWAY);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) went away"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) went away"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) went away"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Away"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserAway", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Away"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("away.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) went away"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) went away"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went away"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Away"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserAway", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Away"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("away.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40073bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40073tx", COLOR_TX_DEFAULT);
//NA
index = Index(ID_STATUS_NA);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) isn't there anymore!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) isn't there anymore!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) isn't there anymore!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("NA"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserNA", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Not available"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("na.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) isn't there anymore!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) isn't there anymore!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) isn't there anymore!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("NA"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserNA", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Not available"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("na.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40075bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40075tx", COLOR_TX_DEFAULT);
//Occupied
index = Index(ID_STATUS_OCCUPIED);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) has something else to do"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) has something else to do"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) has something else to do"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Occupied"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserOccupied", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Occupied"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("occupied.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) has something else to do"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) has something else to do"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) has something else to do"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Occupied"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOccupied", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Occupied"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("occupied.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40076bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40076tx", COLOR_TX_DEFAULT);
//DND
index = Index(ID_STATUS_DND);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) doesn't want to be disturbed!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) doesn't want to be disturbed!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) doesn't want to be disturbed!"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("DND"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserDND", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Do not disturb"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("dnd.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) doesn't want to be disturbed!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) doesn't want to be disturbed!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) doesn't want to be disturbed!"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("DND"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserDND", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Do not disturb"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("dnd.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40074bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40074tx", COLOR_TX_DEFAULT);
//Out to lunch
index = Index(ID_STATUS_OUTTOLUNCH);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) is eating something"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) is eating something"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) is eating something"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("Out to lunch"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserOutToLunch", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Out to lunch"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("lunch.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) is eating something"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) is eating something"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is eating something"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Out to lunch"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOutToLunch", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Out to lunch"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("lunch.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40080bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40080tx", COLOR_TX_DEFAULT);
//On the phone
index = Index(ID_STATUS_ONTHEPHONE);
- lstrcpyn(StatusList[index].lpzMStatusText, TranslateT("(M) had to answer the phone"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzFStatusText, TranslateT("(F) had to answer the phone"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzUStatusText, TranslateT("(U) had to answer the phone"), MAX_STATUSTEXT);
- lstrcpyn(StatusList[index].lpzStandardText, TranslateT("On the phone"), MAX_STANDARDTEXT);
- lstrcpynA(StatusList[index].lpzSkinSoundName, "UserOnThePhone", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusList[index].lpzSkinSoundDesc, LPGENT("User: On the phone"), MAX_SKINSOUNDDESC);
- lstrcpyn(StatusList[index].lpzSkinSoundFile, _T("phone.wav"), MAX_PATH);
+ mir_tstrncpy(StatusList[index].lpzMStatusText, TranslateT("(M) had to answer the phone"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzFStatusText, TranslateT("(F) had to answer the phone"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) had to answer the phone"), MAX_STATUSTEXT);
+ mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("On the phone"), MAX_STANDARDTEXT);
+ mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnThePhone", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: On the phone"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundFile, _T("phone.wav"), MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40079bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40079tx", COLOR_TX_DEFAULT);
@@ -1002,38 +1002,38 @@ void InitStatusList()
//From offline
index = ID_STATUS_FROMOFFLINE;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, "UserFromOffline", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, "UserFromOffline", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
//Status message removed
index = ID_STATUS_SMSGREMOVED;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, "StatusMsgRemoved", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message removed"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgRemoved", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message removed"), MAX_SKINSOUNDDESC);
//Status message changed
index = ID_STATUS_SMSGCHANGED;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, "StatusMsgChanged", MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message changed"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgChanged", MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message changed"), MAX_SKINSOUNDDESC);
//Extra status removed
index = ID_STATUS_XREMOVED;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_REMOVED, MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status removed"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_REMOVED, MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status removed"), MAX_SKINSOUNDDESC);
//Extra status message changed
index = ID_STATUS_XMSGCHANGED;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGCHANGED, MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message changed"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGCHANGED, MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message changed"), MAX_SKINSOUNDDESC);
//Extra status changed
index = ID_STATUS_XCHANGED;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_CHANGED, MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status changed"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_CHANGED, MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status changed"), MAX_SKINSOUNDDESC);
//Extra status message removed
index = ID_STATUS_XMSGREMOVED;
- lstrcpynA(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGREMOVED, MAX_SKINSOUNDNAME);
- lstrcpyn(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message removed"), MAX_SKINSOUNDDESC);
+ mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGREMOVED, MAX_SKINSOUNDNAME);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message removed"), MAX_SKINSOUNDDESC);
}
void CALLBACK ConnectionTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp
index 0ab6804695..b3fd4781ea 100644
--- a/plugins/NewXstatusNotify/src/utils.cpp
+++ b/plugins/NewXstatusNotify/src/utils.cpp
@@ -111,24 +111,24 @@ WCHAR *mir_dupToUnicodeEx(char *ptr, UINT CodePage)
TCHAR *AddCR(const TCHAR *stzText)
{
const TCHAR *found;
- int i = 0, len = lstrlen(stzText), j;
+ int i = 0, len = mir_tstrlen(stzText), j;
TCHAR *tmp = (TCHAR *)mir_alloc(1024 * sizeof(TCHAR));
*tmp = _T('\0');
while ((found = _tcsstr((stzText + i), _T("\n"))) != NULL && _tcslen(tmp) + 1 < 1024) {
j = (int)(found - stzText);
- if (lstrlen(tmp) + j - i + 2 < 1024)
+ if (mir_tstrlen(tmp) + j - i + 2 < 1024)
tmp = _tcsncat(tmp, stzText + i, j - i);
else
break;
if (j == 0 || *(stzText + j - 1) != _T('\r'))
- tmp = lstrcat(tmp, _T("\r"));
+ tmp = mir_tstrcat(tmp, _T("\r"));
- tmp = lstrcat(tmp, _T("\n"));
+ tmp = mir_tstrcat(tmp, _T("\n"));
i = j + 1;
}
- if (lstrlen(tmp) + len - i + 1 < 1024)
- tmp = lstrcat(tmp, stzText + i);
+ if (mir_tstrlen(tmp) + len - i + 1 < 1024)
+ tmp = mir_tstrcat(tmp, stzText + i);
return tmp;
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp
index 113d20a642..06cbeffe0e 100644
--- a/plugins/NewXstatusNotify/src/xstatus.cpp
+++ b/plugins/NewXstatusNotify/src/xstatus.cpp
@@ -101,7 +101,7 @@ TCHAR *ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt)
TCHAR *str = (TCHAR *)mir_alloc(2048 * sizeof(TCHAR));
str[0] = _T('\0');
- int len = lstrlen(tmplt);
+ int len = mir_tstrlen(tmplt);
for (int i = 0; i < len; i++) {
tmp[0] = _T('\0');
@@ -112,32 +112,32 @@ TCHAR *ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt)
case 'n':
{
TCHAR stzType[32];
- lstrcpyn(tmp, GetStatusTypeAsString(xsc->type, stzType), SIZEOF(tmp));
+ mir_tstrncpy(tmp, GetStatusTypeAsString(xsc->type, stzType), SIZEOF(tmp));
}
break;
case 't':
if (xsc->stzTitle == NULL || xsc->stzTitle[0] == _T('\0'))
- lstrcpyn(tmp, TranslateT("<no title>"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("<no title>"), SIZEOF(tmp));
else
- lstrcpyn(tmp, xsc->stzTitle, SIZEOF(tmp));
+ mir_tstrncpy(tmp, xsc->stzTitle, SIZEOF(tmp));
break;
case 'm':
if (xsc->stzText == NULL || xsc->stzText[0] == _T('\0'))
- lstrcpyn(tmp, TranslateT("<no status message>"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("<no status message>"), SIZEOF(tmp));
else {
TCHAR *_tmp = AddCR(xsc->stzText);
- lstrcpyn(tmp, _tmp, SIZEOF(tmp));
+ mir_tstrncpy(tmp, _tmp, SIZEOF(tmp));
mir_free(_tmp);
}
break;
case 'c':
if (xsc->hContact == NULL)
- lstrcpyn(tmp, TranslateT("Contact"), SIZEOF(tmp));
+ mir_tstrncpy(tmp, TranslateT("Contact"), SIZEOF(tmp));
else
- lstrcpyn(tmp, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)xsc->hContact, GCDNF_TCHAR), SIZEOF(tmp));
+ mir_tstrncpy(tmp, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)xsc->hContact, GCDNF_TCHAR), SIZEOF(tmp));
break;
default:
@@ -165,10 +165,10 @@ TCHAR *ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt)
tmp[0] = tmplt[i], tmp[1] = _T('\0');
if (tmp[0] != _T('\0')) {
- if (lstrlen(tmp) + lstrlen(str) < 2044)
- lstrcat(str, tmp);
+ if (mir_tstrlen(tmp) + mir_tstrlen(str) < 2044)
+ mir_tstrcat(str, tmp);
else {
- lstrcat(str, _T("..."));
+ mir_tstrcat(str, _T("..."));
break;
}
}
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp
index efe0c49de4..53fa224917 100644
--- a/plugins/NewsAggregator/Src/Services.cpp
+++ b/plugins/NewsAggregator/Src/Services.cpp
@@ -40,7 +40,7 @@ int NewsAggrInit(WPARAM, LPARAM)
if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT _T("\\Avatars\\")_T(DEFAULT_AVATARS_FOLDER)))
FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, _T(""));
else
- lstrcpyn(tszRoot, VARST( _T("%miranda_userdata%\\Avatars\\"_T(DEFAULT_AVATARS_FOLDER))), SIZEOF(tszRoot));
+ mir_tstrncpy(tszRoot, VARST( _T("%miranda_userdata%\\Avatars\\"_T(DEFAULT_AVATARS_FOLDER))), SIZEOF(tszRoot));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
@@ -77,7 +77,7 @@ int NewsAggrPreShutdown(WPARAM, LPARAM)
INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam)
{
if(lParam) {
- lstrcpynA((char *)lParam, MODULE, wParam);
+ mir_strncpy((char *)lParam, MODULE, wParam);
return 0;
}
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp
index 0e162b3674..8638bc5e48 100644
--- a/plugins/Non-IM Contact/src/contactinfo.cpp
+++ b/plugins/Non-IM Contact/src/contactinfo.cpp
@@ -96,7 +96,7 @@ int BrowseForFolder(HWND hwnd,char *szPath)
ITEMIDLIST *pidlResult = SHBrowseForFolder(&bi);
if (pidlResult) {
SHGetPathFromIDListA(pidlResult, szPath);
- lstrcatA(szPath,"\\");
+ mir_strcat(szPath,"\\");
result = 1;
}
pMalloc->Free(pidlResult);
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp
index 226935c79e..4adadbfc6b 100644
--- a/plugins/Non-IM Contact/src/files.cpp
+++ b/plugins/Non-IM Contact/src/files.cpp
@@ -65,7 +65,7 @@ int Openfile(char *outputFile, int saveOpen) //0=save, 1=open
r = GetSaveFileNameA(&ofn);
if (!r)
return 0;
- lstrcpyA(outputFile,filename);
+ mir_strcpy(outputFile,filename);
return 1;
}
diff --git a/plugins/Non-IM Contact/src/http.cpp b/plugins/Non-IM Contact/src/http.cpp
index 5c300de80e..8c7ecb594d 100644
--- a/plugins/Non-IM Contact/src/http.cpp
+++ b/plugins/Non-IM Contact/src/http.cpp
@@ -57,8 +57,8 @@ int InternetDownloadFile (char *szUrl)
else if (nlhrReply->resultCode == 200)
{
// allocate memory and save the retrieved data
- szData = (char *)malloc(lstrlenA(nlhrReply->pData)+2);
- lstrcpynA(szData, nlhrReply->pData, lstrlenA(nlhrReply->pData));
+ szData = (char *)malloc(mir_strlen(nlhrReply->pData)+2);
+ mir_strncpy(szData, nlhrReply->pData, mir_strlen(nlhrReply->pData));
}
// if the recieved code is 302 Moved, Found, etc
else if (nlhrReply->resultCode == 302)
diff --git a/plugins/Non-IM Contact/src/services.cpp b/plugins/Non-IM Contact/src/services.cpp
index 8b2348f9c9..79f4020e3f 100644
--- a/plugins/Non-IM Contact/src/services.cpp
+++ b/plugins/Non-IM Contact/src/services.cpp
@@ -41,7 +41,7 @@ INT_PTR GetLCCaps(WPARAM wParam,LPARAM lParam)
//=======================================================
INT_PTR GetLCName(WPARAM wParam,LPARAM lParam)
{
- lstrcpynA((char*)lParam, MODNAME, wParam);
+ mir_strncpy((char*)lParam, MODNAME, wParam);
return 0;
}
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index 03f5628709..db503b162a 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -452,10 +452,10 @@ void Nudge_ShowPopup(CNudgeElement n, MCONTACT hContact, TCHAR * Message)
NudgePopup.PluginWindowProc = NudgePopupProc;
NudgePopup.PluginData = (void *)1;
- //lstrcpy(NudgePopup.lpzText, Translate(Message));
- lstrcpy(NudgePopup.lptzText, Message);
+ //mir_tstrcpy(NudgePopup.lpzText, Translate(Message));
+ mir_tstrcpy(NudgePopup.lptzText, Message);
- lstrcpy(NudgePopup.lptzContactName, lpzContactName);
+ mir_tstrcpy(NudgePopup.lptzContactName, lpzContactName);
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&NudgePopup, 0);
}
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp
index 4944abfeb8..081cae06b8 100644
--- a/plugins/PackUpdater/Src/Notifications.cpp
+++ b/plugins/PackUpdater/Src/Notifications.cpp
@@ -115,8 +115,8 @@ VOID show_popup(HWND hDlg, LPCTSTR Title, LPCTSTR Text, int Number, int ActType)
pd.cbSize = sizeof(pd);
pd.lchContact = NULL; //(HANDLE)wParam;
pd.lchIcon = LoadSkinnedIcon(PopupsList[Number].Icon);
- lstrcpyn(pd.lptzText, Text, SIZEOF(pd.lptzText));
- lstrcpyn(pd.lptzContactName, Title, SIZEOF(pd.lptzContactName));
+ mir_tstrncpy(pd.lptzText, Text, SIZEOF(pd.lptzText));
+ mir_tstrncpy(pd.lptzContactName, Title, SIZEOF(pd.lptzContactName));
switch (MyOptions.DefColors) {
case byCOLOR_WINDOWS:
pd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -179,7 +179,7 @@ static void __stdcall CreateDownloadDialog(void*)
if ( ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL,MODNAME, "Popups3", DEFAULT_POPUP_ENABLED))
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POPUPDUMMI), NULL, DlgDownloadPop);
else if (db_get_b(NULL,MODNAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
- lstrcpyn(tszDialogMsg, Text, SIZEOF(tszDialogMsg));
+ mir_tstrncpy(tszDialogMsg, Text, SIZEOF(tszDialogMsg));
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DOWNLOAD), NULL, DlgDownload);
}
}
@@ -369,16 +369,16 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
CreateDirectory(tszFileDest, NULL);
break;
default:
- lstrcpyn(tszFileDest, tszRoot, SIZEOF(tszFileDest));
+ mir_tstrncpy(tszFileDest, tszRoot, SIZEOF(tszFileDest));
break;
}
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%s\\Backups"), tszRoot);
CreateDirectory(tszBuff, NULL);
- lstrcpyn(tszFileName, todo[i].File.tszDiskPath, SIZEOF(tszFileName));
+ mir_tstrncpy(tszFileName, todo[i].File.tszDiskPath, SIZEOF(tszFileName));
mir_sntprintf(todo[i].File.tszDiskPath, SIZEOF(todo[i].File.tszDiskPath), _T("%s\\%s"), tszFileDest, tszFileName);
UpdatesCount++;
- tszExt = &todo[i].File.tszDownloadURL[lstrlen(todo[i].File.tszDownloadURL)-5];
+ tszExt = &todo[i].File.tszDownloadURL[mir_tstrlen(todo[i].File.tszDownloadURL)-5];
if (lstrcmp(tszExt, _T(".html")) == 0) {
char* szUrl = mir_t2a(todo[i].File.tszDownloadURL);
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)szUrl);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
continue;
}
}
- lstrcpyn(todo[i].tszCurVer, todo[i].tszNewVer, SIZEOF(todo[i].tszCurVer));
+ mir_tstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, SIZEOF(todo[i].tszCurVer));
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_CurrentVersion", todo[i].FileNum);
db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
@@ -413,9 +413,9 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
}
if (UpdatesCount > 1 && lstrcmp(arExt[0].c_str(), _T(".html")) != 0)
- lstrcpyn(tszBuff, TranslateT("Downloads complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
+ mir_tstrncpy(tszBuff, TranslateT("Downloads complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
else if (UpdatesCount == 1 && lstrcmp(arExt[0].c_str(), _T(".html")) != 0)
- lstrcpyn(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
+ mir_tstrncpy(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
if (UpdatesCount > 0 && lstrcmp(arExt[0].c_str(), _T(".html")) != 0) {
INT rc = -1;
Title = TranslateT("Pack Updater");
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp
index ed5213062e..ab5e8d63ca 100644
--- a/plugins/PackUpdater/Src/PackUpdater.cpp
+++ b/plugins/PackUpdater/Src/PackUpdater.cpp
@@ -55,7 +55,7 @@ extern "C" __declspec(dllexport) int Load(void)
mir_getLP(&pluginInfoEx);
TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_userdata%\\"DEFAULT_UPDATES_FOLDER));
- lstrcpyn(tszRoot, tszFolder, SIZEOF(tszRoot));
+ mir_tstrncpy(tszRoot, tszFolder, SIZEOF(tszRoot));
hPackUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Pack Updater"), MIRANDA_USERDATAT _T("\\")DEFAULT_UPDATES_FOLDER);
if (hPackUpdaterFolder)
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp
index 49d13a9f6d..7a92f49655 100644
--- a/plugins/PackUpdater/Src/Utils.cpp
+++ b/plugins/PackUpdater/Src/Utils.cpp
@@ -211,10 +211,10 @@ static void CheckUpdates(void *)
}
// Download version info
pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl));
- lstrcpyn(pFileUrl->tszDownloadURL, dbVar.ptszVal, SIZEOF(pFileUrl->tszDownloadURL));
+ mir_tstrncpy(pFileUrl->tszDownloadURL, dbVar.ptszVal, SIZEOF(pFileUrl->tszDownloadURL));
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%s\\tmp.ini"), tszRoot);
- lstrcpyn(pFileUrl->tszDiskPath, tszBuff, SIZEOF(pFileUrl->tszDiskPath));
- lstrcpyn(tszTmpIni, tszBuff, SIZEOF(tszTmpIni));
+ mir_tstrncpy(pFileUrl->tszDiskPath, tszBuff, SIZEOF(pFileUrl->tszDiskPath));
+ mir_tstrncpy(tszTmpIni, tszBuff, SIZEOF(tszTmpIni));
Title = TranslateT("Pack Updater");
Text = TranslateT("Downloading version info...");
DlgDownloadProc();
@@ -232,18 +232,18 @@ static void CheckUpdates(void *)
db_get_ts(NULL, MODNAME, szKey, &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0) {
db_free(&dbVar);
- lstrcpyn(FileInfo.tszCurVer, _T(""), SIZEOF(FileInfo.tszCurVer));
+ mir_tstrncpy(FileInfo.tszCurVer, _T(""), SIZEOF(FileInfo.tszCurVer));
}
- else lstrcpyn(FileInfo.tszCurVer, dbVar.ptszVal, SIZEOF(FileInfo.tszCurVer));
+ else mir_tstrncpy(FileInfo.tszCurVer, dbVar.ptszVal, SIZEOF(FileInfo.tszCurVer));
dbVar.ptszVal = NULL;
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_LastVersion", CurrentFile + 1);
db_get_ts(NULL, MODNAME, szKey, &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0) {
db_free(&dbVar);
- lstrcpyn(FileInfo.tszLastVer, _T(""), SIZEOF(FileInfo.tszLastVer));
+ mir_tstrncpy(FileInfo.tszLastVer, _T(""), SIZEOF(FileInfo.tszLastVer));
}
- else lstrcpyn(FileInfo.tszLastVer, dbVar.ptszVal, SIZEOF(FileInfo.tszLastVer));
+ else mir_tstrncpy(FileInfo.tszLastVer, dbVar.ptszVal, SIZEOF(FileInfo.tszLastVer));
Files.push_back(FileInfo);
@@ -267,7 +267,7 @@ static void CheckUpdates(void *)
MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
continue;
} // end check update name
- lstrcpyn(Files[CurrentFile].File.tszDiskPath, tszBuff, SIZEOF(Files[CurrentFile].File.tszDiskPath));
+ mir_tstrncpy(Files[CurrentFile].File.tszDiskPath, tszBuff, SIZEOF(Files[CurrentFile].File.tszDiskPath));
GetPrivateProfileString(tszFileInfo, _T("InfoURL"), _T(""), Files[CurrentFile].tszInfoURL, SIZEOF(Files[CurrentFile].tszInfoURL), tszTmpIni);
Files[CurrentFile].FileType = GetPrivateProfileInt(tszFileInfo, _T("FileType"), 0, tszTmpIni);
Files[CurrentFile].Force = GetPrivateProfileInt(tszFileInfo, _T("Force"), 0, tszTmpIni);
@@ -335,7 +335,7 @@ static void CheckUpdates(void *)
if (Files[CurrentFile].Force || Exists(tszFilePathDest))
UpdateFiles.push_back(Files[CurrentFile]);
// Save last version
- lstrcpyn(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, SIZEOF(Files[CurrentFile].tszLastVer));
+ mir_tstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, SIZEOF(Files[CurrentFile].tszLastVer));
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_LastVersion", CurrentFile + 1);
db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index 62f4bdd16a..4f4a9fee28 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -411,19 +411,19 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
//DrawIconEx(dis->hDC,dis->rcItem.left,(dis->rcItem.top + dis->rcItem.bottom - GetSystemMetrics(SM_CYSMICON))>>1,hIcon,0, 0, 0, NULL, DI_NORMAL);
DrawIconEx(dis->hDC,dis->rcItem.left,dis->rcItem.top + ((options.row_height - 16)>>1),hIcon,0, 0, 0, NULL, DI_NORMAL);
- GetTextExtentPoint32(dis->hDC,itemData.pszLabel,lstrlen(itemData.pszLabel),&textSize);
- TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,itemData.pszLabel,lstrlen(itemData.pszLabel));
+ GetTextExtentPoint32(dis->hDC,itemData.pszLabel,mir_tstrlen(itemData.pszLabel),&textSize);
+ TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,itemData.pszLabel,mir_tstrlen(itemData.pszLabel));
if(itemData.status != PS_DISABLED) {
TCHAR buf[256];
if(itemData.responding) {
mir_sntprintf(buf, 256, TranslateT("%d ms"), itemData.round_trip_time);
- GetTextExtentPoint32(dis->hDC,buf,lstrlen(buf),&textSize);
- TextOut(dis->hDC,dis->rcItem.right - textSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom -textSize.cy)>>1,buf,lstrlen(buf));
+ GetTextExtentPoint32(dis->hDC,buf,mir_tstrlen(buf),&textSize);
+ TextOut(dis->hDC,dis->rcItem.right - textSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom -textSize.cy)>>1,buf,mir_tstrlen(buf));
} else if(itemData.miss_count > 0) {
mir_sntprintf(buf, 256, _T("[%d]"), itemData.miss_count);
- GetTextExtentPoint32(dis->hDC,buf,lstrlen(buf),&textSize);
- TextOut(dis->hDC,dis->rcItem.right - textSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom -textSize.cy)>>1,buf,lstrlen(buf));
+ GetTextExtentPoint32(dis->hDC,buf,mir_tstrlen(buf),&textSize);
+ TextOut(dis->hDC,dis->rcItem.right - textSize.cx - 2,(dis->rcItem.top + dis->rcItem.bottom -textSize.cy)>>1,buf,mir_tstrlen(buf));
}
}
SetBkMode(dis->hDC, OPAQUE);
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp
index 22c8d854a9..db3e581b59 100644
--- a/plugins/Popup/src/actions.cpp
+++ b/plugins/Popup/src/actions.cpp
@@ -96,7 +96,7 @@ bool IsActionEnabled(char *name)
{
POPUPACTION action = {0};
action.flags = PAF_ENABLED;
- lstrcpyA(action.lpzTitle, name);
+ mir_strcpy(action.lpzTitle, name);
return IsActionEnabled(&action);
}
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
char *szName = strchr(gActions[i]->lpzTitle, '/');
if (!szName) szName = gActions[i]->lpzTitle;
else ++szName;
- lstrcpynA(szGroup, gActions[i]->lpzTitle, szName - gActions[i]->lpzTitle);
+ mir_strncpy(szGroup, gActions[i]->lpzTitle, szName - gActions[i]->lpzTitle);
int grpId = 0;
@@ -246,7 +246,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
group.mask = LVGF_HEADER | LVGF_GROUPID;
LPTSTR wszGroup = mir_a2t(szGroup);
group.pszHeader = TranslateTS(wszGroup);
- group.cchHeader = lstrlen(wszGroup);
+ group.cchHeader = mir_tstrlen(wszGroup);
grpId = group.iGroupId = groups.getCount();
int grpId = ListView_InsertGroup(hwndList, -1, &group);
mir_free(wszGroup);
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp
index 91cb7093d2..821aa10017 100644
--- a/plugins/Popup/src/bitmap_funcs.cpp
+++ b/plugins/Popup/src/bitmap_funcs.cpp
@@ -596,10 +596,10 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
void MyBitmap::Draw_Text(TCHAR *str, int x, int y)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, lstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
this->saveAlpha(x, y, sz.cx, sz.cy);
- DrawText(this->getDC(), str, lstrlen(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
+ DrawText(this->getDC(), str, mir_tstrlen(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
this->restoreAlpha(x, y, sz.cx, sz.cy);
}
@@ -680,7 +680,7 @@ bool MyBitmap::loadFromFile_pixel(const TCHAR *fn, const TCHAR *fnAlpha)
{
allocate(1, 1);
int r, g, b, a = 255;
- const TCHAR *p = fn + lstrlen(_T("pixel:"));
+ const TCHAR *p = fn + mir_tstrlen(_T("pixel:"));
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
@@ -690,7 +690,7 @@ bool MyBitmap::loadFromFile_pixel(const TCHAR *fn, const TCHAR *fnAlpha)
bool MyBitmap::loadFromFile_gradient(const TCHAR *fn, const TCHAR *fnAlpha)
{
- const TCHAR *p = fn + lstrlen(_T("gradient:"));
+ const TCHAR *p = fn + mir_tstrlen(_T("gradient:"));
if (*p == 'h') allocate(256, 1);
else allocate(1, 256);
@@ -825,10 +825,10 @@ bool MyBitmap::loadFromFile(const TCHAR *fn, const TCHAR *fnAlpha)
{
if (bits) freemem();
- if (!_tcsncmp(fn, _T("pixel:"), lstrlen(_T("pixel:"))))
+ if (!_tcsncmp(fn, _T("pixel:"), mir_tstrlen(_T("pixel:"))))
return loadFromFile_pixel(fn, fnAlpha);
- if (!_tcsncmp(fn, _T("gradient:"), lstrlen(_T("gradient:"))))
+ if (!_tcsncmp(fn, _T("gradient:"), mir_tstrlen(_T("gradient:"))))
return loadFromFile_gradient(fn, fnAlpha);
TCHAR ext[5];
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp
index 034a8f002c..d481fc63c9 100644
--- a/plugins/Popup/src/font.cpp
+++ b/plugins/Popup/src/font.cpp
@@ -29,41 +29,41 @@ void InitFonts() {
// Fonts
FontIDT fid = {0};
fid.cbSize = sizeof(FontIDT);
- lstrcpyn(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.group));
+ mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.group));
strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
- lstrcpyn(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), SIZEOF(fid.backgroundGroup));
- lstrcpyn(fid.backgroundName, PU_COL_BACK_NAME, SIZEOF(fid.backgroundName));
- lstrcpyn(fid.deffontsettings.szFace, _T("Tahoma"), SIZEOF(fid.deffontsettings.szFace));
+ mir_tstrncpy(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), SIZEOF(fid.backgroundGroup));
+ mir_tstrncpy(fid.backgroundName, PU_COL_BACK_NAME, SIZEOF(fid.backgroundName));
+ mir_tstrncpy(fid.deffontsettings.szFace, _T("Tahoma"), SIZEOF(fid.deffontsettings.szFace));
- lstrcpyn(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name));
mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
//fid.deffontsettings.style = DBFONTF_BOLD;
//fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
//fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
//fid.deffontsettings.style = 0;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
//fid.deffontsettings.colour = RGB(0, 0, 255);
@@ -71,15 +71,15 @@ void InitFonts() {
ColourIDT cid = {0};
cid.cbSize = sizeof(ColourIDT);
- lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
+ mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(cid.dbSettingsGroup));
- lstrcpyn(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
+ mir_tstrncpy(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
strncpy(cid.setting, PU_COL_BACK_SETTING, SIZEOF(cid.setting));
cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
ColourRegisterT(&cid);
- lstrcpyn(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
+ mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
strncpy(cid.setting, PU_COL_AVAT_SETTING, SIZEOF(cid.setting));
cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
ColourRegisterT(&cid);
@@ -99,36 +99,36 @@ void ReloadFonts()
LOGFONT lf = {0};
FontIDT fid = {0};
fid.cbSize = sizeof(FontIDT);
- lstrcpyn(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.name));
+ mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.name));
- lstrcpyn(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name));
fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.title = CreateFontIndirect(&lf);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.clock = CreateFontIndirect(&lf);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.text = CreateFontIndirect(&lf);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.action = CreateFontIndirect(&lf);
- lstrcpyn(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.actionHover = CreateFontIndirect(&lf);
ColourIDT cid = {0};
cid.cbSize = sizeof(ColourIDT);
- lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
- lstrcpyn(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
+ mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
+ mir_tstrncpy(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
- lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
- lstrcpyn(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
+ mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
+ mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
//update class popupps(only temp at this point, must rework)
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h
index b3b682e361..eeab5d9f65 100644
--- a/plugins/Popup/src/font.h
+++ b/plugins/Popup/src/font.h
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PU_FNT_AND_COLOR_DB MODULNAME //use eg strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
-#define PU_FNT_NAME_TITLE LPGEN("Title") //use eg lstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
+#define PU_FNT_NAME_TITLE LPGEN("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
#define PU_FNT_NAME_CLOCK LPGEN("Clock")
#define PU_FNT_NAME_TEXT LPGEN("Text")
#define PU_FNT_NAME_ACTION LPGEN("Action")
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index f8ebfe9eda..57fbf18b62 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -46,24 +46,24 @@ void LoadNotifications()
notification.actionCount = 0;
notification.lpActions = 0;
- lstrcpynA(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
- lstrcpynA(notification.lpzName, "Warning", sizeof(notification.lpzName));
+ mir_strncpy(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
+ mir_strncpy(notification.lpzName, "Warning", sizeof(notification.lpzName));
notification.lchIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MB_WARN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED);
notification.colorBack = RGB(210,210,150);
notification.colorText = RGB(0,0,0);
notification.iSeconds = 10;
g_hntfWarning = RegisterNotification(&notification);
- lstrcpynA(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
- lstrcpynA(notification.lpzName, "Notification", sizeof(notification.lpzName));
+ mir_strncpy(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
+ mir_strncpy(notification.lpzName, "Notification", sizeof(notification.lpzName));
notification.lchIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MB_INFO), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED);
notification.colorBack = RGB(230,230,230);
notification.colorText = RGB(0,0,0);
notification.iSeconds = 7;
g_hntfNotification = RegisterNotification(&notification);
- lstrcpynA(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
- lstrcpynA(notification.lpzName, "Error", sizeof(notification.lpzName));
+ mir_strncpy(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
+ mir_strncpy(notification.lpzName, "Error", sizeof(notification.lpzName));
notification.lchIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MB_STOP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED);
notification.colorBack = RGB(191,0,0);
notification.colorText = RGB(255,245,225);
@@ -160,12 +160,12 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
- lstrcpynA(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
+ mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzRAction);
- lstrcpynA(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
+ mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
}
}
@@ -188,12 +188,12 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
FontID fontid = {0};
fontid.cbSize = sizeof(fontid);
mir_snprintf(fontid.group, sizeof(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
- lstrcpyA(fontid.dbSettingsGroup, "PopupNotifications");
+ mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.colour = ptd->notification.colorText;
fontid.deffontsettings.size = -11;
- lstrcpynA(fontid.deffontsettings.szFace, "MS Shell Dlg", SIZEOF(fontid.deffontsettings.szFace));
+ mir_strncpy(fontid.deffontsettings.szFace, "MS Shell Dlg", SIZEOF(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", notification->lpzName);
mir_snprintf(fontid.prefix, SIZEOF(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName);
@@ -203,7 +203,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
ColourID colourid = {0};
colourid.cbSize = sizeof(colourid);
mir_snprintf(colourid.group, sizeof(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
- lstrcpyA(colourid.dbSettingsGroup, "PopupNotifications");
+ mir_strcpy(colourid.dbSettingsGroup, "PopupNotifications");
mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", notification->lpzName);
mir_snprintf(colourid.setting, SIZEOF(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
colourid.defcolour = ptd->notification.colorBack;
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index 8289dbb279..4fd1d07894 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -397,13 +397,13 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case CBN_SELCHANGE: //ComboBox controls
switch(idCtrl) {
case IDC_LACTION:
- lstrcpynA(ptd->leftAction,
+ mir_strncpy(ptd->leftAction,
(char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
sizeof(ptd->leftAction));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case IDC_RACTION:
- lstrcpynA(ptd->rightAction,
+ mir_strncpy(ptd->rightAction,
(char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
sizeof(ptd->rightAction));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -508,12 +508,12 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
mir_snprintf(setting, sizeof(setting), "%s/leftAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); //standart ??
- lstrcpynA(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
+ mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
mir_snprintf(setting, sizeof(setting), "%s/rightAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); //standart ??
- lstrcpynA(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
+ mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 781b009795..c104eb2c3a 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -47,24 +47,24 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
if (!flag) return pos;
options[pos].dwFlag = flag;
options[pos].groupId = OPTTREE_CHECK;
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR) * lstrlen(prefix) + 32);
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR) * mir_tstrlen(prefix) + 32);
options[pos].pszSettingName = mir_tstrdup(prefix);
options[pos].iconIndex = 0;
- lstrcpy(options[pos].pszOptionName, prefix);
- lstrcat(options[pos].pszOptionName, _T("/"));
+ mir_tstrcpy(options[pos].pszOptionName, prefix);
+ mir_tstrcat(options[pos].pszOptionName, _T("/"));
switch (flag)
{
- case PF2_IDLE: lstrcat(options[pos].pszOptionName, LPGENT("Offline")); break;
- case PF2_ONLINE: lstrcat(options[pos].pszOptionName, LPGENT("Online")); break;
- case PF2_INVISIBLE: lstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break;
- case PF2_SHORTAWAY: lstrcat(options[pos].pszOptionName, LPGENT("Away")); break;
- case PF2_LONGAWAY: lstrcat(options[pos].pszOptionName, LPGENT("NA")); break;
- case PF2_LIGHTDND: lstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break;
- case PF2_HEAVYDND: lstrcat(options[pos].pszOptionName, LPGENT("DND")); break;
- case PF2_FREECHAT: lstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break;
- case PF2_OUTTOLUNCH: lstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break;
- case PF2_ONTHEPHONE: lstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break;
+ case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Offline")); break;
+ case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Online")); break;
+ case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break;
+ case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Away")); break;
+ case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("NA")); break;
+ case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break;
+ case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("DND")); break;
+ case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break;
+ case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break;
+ case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break;
}
return pos + 1;
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index e00a7a6b32..7b441978ed 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -187,8 +187,8 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
options[pos].iconIndex = 0;
options[pos].pszSettingName = mir_tstrdup(_T("Skin options"));
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
- lstrlen(options[pos].pszSettingName)+
- lstrlenA(skin->getFlagName(i)) +10 ));
+ mir_tstrlen(options[pos].pszSettingName)+
+ mir_strlen(skin->getFlagName(i)) +10 ));
wsprintf(options[pos].pszOptionName, _T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i)); //!!!!!!!!!!!!!
options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
options[pos].Data = i; //skin flag index
@@ -248,8 +248,8 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos,
options[pos].iconIndex = 0;
options[pos].pszSettingName = mir_tstrdup(LPGENT("Global settings"));
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
- lstrlen(options[pos].pszSettingName)+
- lstrlen(mainOption[i]) + 10));
+ mir_tstrlen(options[pos].pszSettingName)+
+ mir_tstrlen(mainOption[i]) + 10));
wsprintf(options[pos].pszOptionName, _T("%s/%s"), options[pos].pszSettingName, mainOption[i]); //!!!!!!!!!!!!!
options[pos].bState = bCheck;
pos++;
@@ -559,12 +559,12 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
rc.left += 30; // 10+16+4 -- icon
rc.right -= (rc.right-rc.left)/3;
rc.bottom -= (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), lstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ DrawText(mydc, _T(MODULNAME_LONG), mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
GetClientRect(hwnd, &rc);
rc.left += 30; // 10+16+4 -- icon
rc.left += (rc.right-rc.left)/3;
rc.top += (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), lstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ DrawText(mydc, _T(MODULNAME_LONG), mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
GetClientRect(hwnd, &rc);
FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
SelectObject(mydc, hfnt);
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp
index 1c670e06b0..c7729d199d 100644
--- a/plugins/Popup/src/opttree.cpp
+++ b/plugins/Popup/src/opttree.cpp
@@ -101,7 +101,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd
int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
- lstrcpy(itemName, name);
+ mir_tstrcpy(itemName, name);
sectionName = itemName;
while (sectionName) {
@@ -176,7 +176,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, i
int sectionLevel = 0;
HTREEITEM hSection = NULL;
- lstrcpy(itemName, options[indx].pszOptionName);
+ mir_tstrcpy(itemName, options[indx].pszOptionName);
sectionName = itemName;
while (sectionName) {
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index 70c6fa820a..16fcc7ed6d 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -282,7 +282,7 @@ void PopupWnd2::update()
{
SetTextColor(hdc, m_clClock);
HFONT hfnSave = (HFONT)SelectObject(m_bmpBase->getDC(), fonts.clock);
- SIZE sz; GetTextExtentPoint32(m_bmpBase->getDC(), m_time, lstrlen(m_time), &sz);
+ SIZE sz; GetTextExtentPoint32(m_bmpBase->getDC(), m_time, mir_tstrlen(m_time), &sz);
m_bmpBase->Draw_Text(m_time, this->m_sz.cx - sz.cx - STYLE_SZ_GAP - skin->getRightGap(), STYLE_SZ_GAP);
SelectObject(m_bmpBase->getDC(), hfnSave);
}
@@ -609,7 +609,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_REPLY,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Quick reply");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Quick reply");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_REPLY;
++iAction;
@@ -618,7 +618,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && isIm && IsActionEnabled("General/Send message")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_MESS,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Send message");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Send message");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_MESSAGE;
++iAction;
@@ -627,7 +627,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && IsActionEnabled("General/User details")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_INFO,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/User details");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/User details");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_DETAILS;
++iAction;
@@ -636,7 +636,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && IsActionEnabled("General/Contact menu")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_MENU,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Contact menu");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Contact menu");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_MENU;
++iAction;
@@ -645,7 +645,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && db_get_b(m_hContact, "CList", "NotOnList", 0) && IsActionEnabled("General/Add permanently")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_ADD,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Add permanently");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Add permanently");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_ADD;
++iAction;
@@ -654,7 +654,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultGen && (m_iTimeout != -1) && IsActionEnabled("General/Pin popup")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = m_bIsPinned ? IcoLib_GetIcon(ICO_ACT_PINNED,iconSize) : IcoLib_GetIcon(ICO_ACT_PIN,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Pin popup");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Pin popup");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_PIN;
++iAction;
@@ -663,7 +663,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultGen && IsActionEnabled("General/Dismiss popup")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_CLOSE,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Dismiss popup");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Dismiss popup");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_DISMISS;
++iAction;
@@ -672,7 +672,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultGen && IsActionEnabled("General/Copy to clipboard")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_COPY,iconSize);
- lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Copy to clipboard");
+ mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Copy to clipboard");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_COPY;
++iAction;
@@ -886,9 +886,9 @@ void AddMessageToDB(MCONTACT hContact, char *msg, int flag/*bool utf*/)
dbei.szModule = GetContactProto(hContact);
dbei.timestamp = time(NULL);
if ( !((flag & PREF_UTF) == PREF_UTF) && (flag & PREF_UNICODE) == PREF_UNICODE)
- dbei.cbBlob = (lstrlen((LPTSTR)msg) + 1)*sizeof(TCHAR);
+ dbei.cbBlob = (mir_tstrlen((LPTSTR)msg) + 1)*sizeof(TCHAR);
else
- dbei.cbBlob = lstrlenA(msg) + 1;
+ dbei.cbBlob = mir_strlen(msg) + 1;
dbei.pBlob = (PBYTE)msg;
db_event_add(hContact, &dbei);
}
@@ -1080,9 +1080,9 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
}
OpenClipboard(m_hwnd);
EmptyClipboard();
- clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (lstrlen(text)+1) * sizeof(TCHAR));
+ clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (mir_tstrlen(text)+1) * sizeof(TCHAR));
buffer = (TCHAR *)GlobalLock(clipbuffer);
- lstrcpy(buffer, text);
+ mir_tstrcpy(buffer, text);
GlobalUnlock(clipbuffer);
SetClipboardData(CF_TCHAR, clipbuffer);
CloseClipboard();
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index fe16ce2fb4..c33a3f96a0 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -63,7 +63,7 @@ SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const
SIZE szText, szSpace;
LPTSTR wname = mir_a2t(name);
TCHAR *str = TranslateTS(wname);
- GetTextExtentPoint32(hdc, str, lstrlen(str), &szText);
+ GetTextExtentPoint32(hdc, str, mir_tstrlen(str), &szText);
mir_free(wname);
GetTextExtentPoint32(hdc, _T(" "), 1, &szSpace);
@@ -126,7 +126,7 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
LPTSTR wname = mir_a2t(name);
TCHAR *str = TranslateTS(wname);
- GetTextExtentPoint32(bmp->getDC(), str, lstrlen(str), &szText);
+ GetTextExtentPoint32(bmp->getDC(), str, mir_tstrlen(str), &szText);
bmp->Draw_Text(str,
(PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
max(y + 2, y + 2 + (((PopupOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
@@ -196,7 +196,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
}
else { //normal clock
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), lstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
wnd->getArgs()->add("clock.width", sz.cx + 2 * STYLE_SZ_GAP);
wnd->getArgs()->add("clock.height", sz.cy);
@@ -239,7 +239,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
- DrawTextEx(hdc, wnd->getText(), lstrlen(wnd->getText()), &rc,
+ DrawTextEx(hdc, wnd->getText(), mir_tstrlen(wnd->getText()), &rc,
DT_CALCRECT | DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
szNew.cx = rc.right;
szNew.cy = rc.bottom;
@@ -282,7 +282,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
- DrawTextEx(hdc, wnd->getTitle(), lstrlen(wnd->getTitle()), &rc,
+ DrawTextEx(hdc, wnd->getTitle(), mir_tstrlen(wnd->getTitle()), &rc,
DT_CALCRECT | DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
szNew.cx = rc.right;
szNew.cy = rc.bottom;
@@ -344,7 +344,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
}
else {
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), lstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
wnd->getArgs()->add("clock.width", sz.cx + 2 * STYLE_SZ_GAP);
wnd->getArgs()->add("clock.height", sz.cy);
@@ -438,7 +438,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
}
else {
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), lstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
STYLE_SZ_CLOCK = sz.cx + 2 * STYLE_SZ_GAP;
}
@@ -502,7 +502,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy);
- DrawTextEx(hdc, wnd->getText(), lstrlen(wnd->getText()), &rc,
+ DrawTextEx(hdc, wnd->getText(), mir_tstrlen(wnd->getText()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
}
break;
@@ -551,7 +551,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
{
HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy);
- DrawTextEx(hdc, wnd->getTitle(), lstrlen(wnd->getTitle()), &rc,
+ DrawTextEx(hdc, wnd->getTitle(), mir_tstrlen(wnd->getTitle()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
SelectObject(hdc, hFntSave);
}
@@ -691,7 +691,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
SetTextColor(hdc, wnd->getClockColor());
HFONT hfnSave = (HFONT)SelectObject(bmp->getDC(), fonts.clock);
- SIZE sz; GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), lstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
bmp->Draw_Text(wnd->getTime(), x, y);
SelectObject(bmp->getDC(), hfnSave);
}
@@ -760,7 +760,7 @@ void PopupSkin::loadOptions(std::wistream &f)
TCHAR *p = buf;
while (isspace(*p))
p++;
- TCHAR *q = p + lstrlen(p) - 1;
+ TCHAR *q = p + mir_tstrlen(p) - 1;
while ((q >= p) && isspace(*q))
*q-- = 0;
m_flag_names[id] = mir_t2a(p);
@@ -959,7 +959,7 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f)
f >> buf;
if (((element->type & ST_TYPEMASK) == ST_MYBITMAP) || ((element->type & ST_TYPEMASK) == ST_CLOCK)) {
TCHAR *alpha = mir_tstrdup(buf);
- alpha[lstrlen(alpha) - 1] = 'a';
+ alpha[mir_tstrlen(alpha) - 1] = 'a';
element->myBmp = new MyBitmap(buf, alpha);
mir_free(alpha);
}
@@ -1094,7 +1094,7 @@ bool Skins::load(LPCTSTR dir1)
m_skins = skin;
m_skins->name = mir_tstrdup(_T("* Popup Classic"));
m_skins->dir = new TCHAR[1024];
- lstrcpy(m_skins->dir, _T("res:classic.popupskin"));
+ mir_tstrcpy(m_skins->dir, _T("res:classic.popupskin"));
m_skins->skin = 0;
TCHAR dir[1024] = { '\0' };
@@ -1105,8 +1105,8 @@ bool Skins::load(LPCTSTR dir1)
}
else {
GetModuleFileName(hInst, dir, 1024);
- dir[lstrlen(dir) - 18] = 0;
- lstrcat(dir, _T("\\skins\\popup"));
+ dir[mir_tstrlen(dir) - 18] = 0;
+ mir_tstrcat(dir, _T("\\skins\\popup"));
DWORD fa = GetFileAttributes(dir);
if ((fa == INVALID_FILE_ATTRIBUTES) || !(fa&FILE_ATTRIBUTE_DIRECTORY))
return false;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index dab75c2726..b02897c206 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -400,7 +400,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
if (db_get_ts(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
{
if (dbv.ptszVal != NULL)
- lstrcpyn(contact->szgroup, dbv.ptszVal, SIZEOF(contact->szgroup));
+ mir_tstrncpy(contact->szgroup, dbv.ptszVal, SIZEOF(contact->szgroup));
db_free(&dbv);
}
@@ -408,11 +408,11 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
// Make contact name
TCHAR *tmp = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
- lstrcpyn(contact->szname, tmp, SIZEOF(contact->szname));
+ mir_tstrncpy(contact->szname, tmp, SIZEOF(contact->szname));
PROTOACCOUNT *acc = ProtoGetAccount(pszProto);
if (acc != NULL)
- lstrcpyn(contact->proto, acc->tszAccountName, SIZEOF(contact->proto));
+ mir_tstrncpy(contact->proto, acc->tszAccountName, SIZEOF(contact->proto));
contact->hcontact = hContact;
contacts.insert(contact);
@@ -480,7 +480,7 @@ int CheckText(HWND hdlg, TCHAR *sztext, BOOL only_enable = FALSE)
if(sztext == NULL || sztext[0] == _T('\0'))
return 0;
- int len = lstrlen(sztext);
+ int len = mir_tstrlen(sztext);
if (only_enable)
{
@@ -567,7 +567,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SendMessage(hdlg,WM_GETTEXT,(WPARAM)SIZEOF(sztext),(LPARAM)sztext);
- BOOL at_end = (lstrlen(sztext) == (int)end);
+ BOOL at_end = (mir_tstrlen(sztext) == (int)end);
if (ret != -1)
{
@@ -1041,7 +1041,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
RECT rcc = { 0, 0, 0x7FFF, 0x7FFF };
- DrawText(lpdis->hDC, contacts[loop]->proto, lstrlen(contacts[loop]->proto),
+ DrawText(lpdis->hDC, contacts[loop]->proto, mir_tstrlen(contacts[loop]->proto),
&rcc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_CALCRECT);
max_proto_width = max(max_proto_width, rcc.right - rcc.left);
}
@@ -1059,7 +1059,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
rc_tmp.left = rc_tmp.right - max_proto_width;
- DrawText(lpdis->hDC, contacts[lpdis->itemData]->proto, lstrlen(contacts[lpdis->itemData]->proto),
+ DrawText(lpdis->hDC, contacts[lpdis->itemData]->proto, mir_tstrlen(contacts[lpdis->itemData]->proto),
&rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
rc.right = rc_tmp.left - 5;
@@ -1081,7 +1081,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
rc.right = rc_tmp.left - 5;
}
- DrawText(lpdis->hDC, contacts[lpdis->itemData]->szgroup, lstrlen(contacts[lpdis->itemData]->szgroup),
+ DrawText(lpdis->hDC, contacts[lpdis->itemData]->szgroup, mir_tstrlen(contacts[lpdis->itemData]->szgroup),
&rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
}
@@ -1092,7 +1092,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
else
name = contacts[lpdis->itemData]->szname;
- DrawText(lpdis->hDC, name, lstrlen(name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+ DrawText(lpdis->hDC, name, mir_tstrlen(name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
// Restore old colors
SetTextColor(lpdis->hDC, clrfore);
diff --git a/plugins/Quotes/src/Chart.h b/plugins/Quotes/src/Chart.h
index 62a658d818..8cd4718b94 100644
--- a/plugins/Quotes/src/Chart.h
+++ b/plugins/Quotes/src/Chart.h
@@ -91,7 +91,7 @@ public:
HFONT hOldFont = static_cast<HFONT>(::SelectObject(hdc,hFont));
LPCTSTR pszText = TranslateT("There is no to show");
- int nDrawTextResult = ::DrawText(hdc,pszText,::lstrlen(pszText),&rc,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
+ int nDrawTextResult = ::DrawText(hdc,pszText,::mir_tstrlen(pszText),&rc,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
assert(0 != nDrawTextResult);
::SelectObject(hdc,hOldFont);
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index 933e25c35b..02aaf99b39 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -375,7 +375,7 @@ namespace
// {
// if(lParam)
// {
-// lstrcpynA(reinterpret_cast<char*>(lParam),QUOTES_PROTOCOL_NAME,wParam);
+// mir_strncpy(reinterpret_cast<char*>(lParam),QUOTES_PROTOCOL_NAME,wParam);
// return 0;
// }
// else
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp
index a6c46e894f..6a01feb58f 100644
--- a/plugins/Quotes/src/ImportExport.cpp
+++ b/plugins/Quotes/src/ImportExport.cpp
@@ -170,12 +170,12 @@ namespace
{
LPTSTR p = pszBuffer;
LPCTSTR pszXml = TranslateT("XML File (*.xml)");
- lstrcpyn(p,pszXml, (int)cBuffer);
- size_t nLen = lstrlen(pszXml)+1;
+ mir_tstrncpy(p,pszXml, (int)cBuffer);
+ size_t nLen = mir_tstrlen(pszXml)+1;
p+= nLen;
if(nLen < cBuffer)
{
- lstrcpyn(p,_T("*.xml"),(int)(cBuffer-nLen));
+ mir_tstrncpy(p,_T("*.xml"),(int)(cBuffer-nLen));
p+= 6;
nLen += 6;
}
@@ -183,15 +183,15 @@ namespace
if(nLen < cBuffer)
{
LPCTSTR pszAll = TranslateT("All files (*.*)");
- lstrcpyn(p,pszAll,(int)(cBuffer-nLen));
- size_t n = lstrlen(pszAll)+1;
+ mir_tstrncpy(p,pszAll,(int)(cBuffer-nLen));
+ size_t n = mir_tstrlen(pszAll)+1;
nLen += n;
p+= n;
}
if(nLen < cBuffer)
{
- lstrcpyn(p,_T("*.*"),(int)(cBuffer-nLen));
+ mir_tstrncpy(p,_T("*.*"),(int)(cBuffer-nLen));
p+= 4;
nLen += 4;
}
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp
index d05d21f304..c6553a1c68 100644
--- a/plugins/Quotes/src/QuotesProviderBase.cpp
+++ b/plugins/Quotes/src/QuotesProviderBase.cpp
@@ -576,7 +576,7 @@ namespace
dbei.timestamp = static_cast<DWORD>(nTime);
dbei.flags = DBEF_READ|DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = ::lstrlenA(psz)+1;
+ dbei.cbBlob = ::mir_strlen(psz)+1;
dbei.pBlob = (PBYTE)(char*)psz;
db_event_add(hContact, &dbei);
}
@@ -634,11 +634,11 @@ namespace
CQuotesProviderVisitorFormater visitor(hContact,_T('s'),0);
pProvider->Accept(visitor);
const tstring& sTitle = visitor.GetResult();
- lstrcpyn(ppd.lptzContactName,sTitle.c_str(),MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzContactName,sTitle.c_str(),MAX_CONTACTNAME);
mir_safe_string<TCHAR> ss(variables_parsedup((TCHAR*)rsFormat.c_str(), 0, hContact));
tstring sText = format_rate(pProvider,hContact,ss.m_p,dRate);
- lstrcpyn(ppd.lptzText,sText.c_str(),MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzText,sText.c_str(),MAX_SECONDLINE);
if(CPopupSettings::colourDefault == ps.GetColourMode())
{
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp
index 48f190f1c4..940241b539 100644
--- a/plugins/Quotes/src/SettingsDlg.cpp
+++ b/plugins/Quotes/src/SettingsDlg.cpp
@@ -1066,7 +1066,7 @@ tstring GenerateLogFileName(const tstring& rsLogFilePattern,
{
tstring s = rsQuoteSymbol;
std::for_each(s.begin(),s.end(),boost::bind(replace_invalid_char,_1,_T('_')));
- sPath.replace(n,lstrlen(g_pszVariableQuoteName),s.c_str());
+ sPath.replace(n,mir_tstrlen(g_pszVariableQuoteName),s.c_str());
}
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
index 89f751dbde..28d787b4c3 100644
--- a/plugins/SMS/src/SMS_svc.cpp
+++ b/plugins/SMS/src/SMS_svc.cpp
@@ -10,7 +10,7 @@ int LoadServices(void)
// Service creation
for (size_t i=0;i<SIZEOF(siPluginServices);i++)
{
- CopyMemory(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
+ CopyMemory(pszServiceFunctionName,siPluginServices[i].lpszName,(mir_strlen(siPluginServices[i].lpszName)+1));
CreateServiceFunction(szServiceFunction,(MIRANDASERVICE)siPluginServices[i].lpFunc);
}
return 0;
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp
index cdf497067e..4d40969b44 100644
--- a/plugins/SMS/src/functions.cpp
+++ b/plugins/SMS/src/functions.cpp
@@ -7,7 +7,7 @@ BOOL DB_GetStaticStringW(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,
DBVARIANT dbv={0};
if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv)==0)
{
- dwReadedStringLen=lstrlenW(dbv.pwszVal);
+ dwReadedStringLen=mir_wstrlen(dbv.pwszVal);
if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
{
CopyMemory(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
@@ -455,9 +455,9 @@ void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour)
{
if (db_get(NULL,SRMMMOD,str,&dbv))
{
- lstrcpyn(lf->lfFaceName,fontOptionsList[0].szDefFace,SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName,fontOptionsList[0].szDefFace,SIZEOF(lf->lfFaceName));
}else{
- lstrcpyn(lf->lfFaceName,dbv.ptszVal,SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName,dbv.ptszVal,SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp
index 49838ca61f..49d0283e59 100644
--- a/plugins/SMS/src/receive.cpp
+++ b/plugins/SMS/src/receive.cpp
@@ -42,7 +42,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam)
ACKDATA *ack = ((ACKDATA*)lParam);
if (lpszXML)
- dwXMLSize = lstrlenA(lpszXML);
+ dwXMLSize = mir_strlen(lpszXML);
if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_message", "text", NULL))
{
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp
index 7035b7449f..3d2a74c756 100644
--- a/plugins/SMS/src/senddlg.cpp
+++ b/plugins/SMS/src/senddlg.cpp
@@ -286,7 +286,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l
tvi.pszText=tszPhone;
tvi.cchTextMax=SIZEOF(tszPhone);
TreeView_GetItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),&tvi);
- dwPhoneSize=lstrlen(tszPhone);
+ dwPhoneSize=mir_tstrlen(tszPhone);
}else{
dwPhoneSize=GetDlgItemText(hWndDlg,IDC_ADDRESS,tszPhone,SIZEOF(tszPhone));
}
@@ -409,7 +409,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l
{
if (IsContactPhone(psswdWindowData->hMyContact,tszPhone,dwPhoneSize)==FALSE)
{
- lstrcat(tszPhone, _T(" SMS"));
+ mir_tstrcat(tszPhone, _T(" SMS"));
for(DWORD i=0;bCont;i++)
{
mir_snprintf(szBuff,SIZEOF(szBuff),"MyPhone%d",i);
@@ -883,7 +883,7 @@ void SendSMSWindowNext(HWND hWndDlg)
tvi.cchTextMax=SIZEOF(tszPhone);
TreeView_GetItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),&tvi);
TreeView_SelectItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),tvi.hItem);
- dwPhoneSize=lstrlenW(tszPhone);
+ dwPhoneSize=mir_wstrlen(tszPhone);
SendSMSWindowNumberSet(hWndDlg,tszPhone,dwPhoneSize);
StartSmsSend(hWndDlg,SendDlgItemMessage(hWndDlg,IDC_ACCOUNTS,CB_GETCURSEL,0,0),tszPhone,dwPhoneSize,lptszMessage,dwMessageSize);
SetTimer(hWndDlg,TIMERID_MSGSEND,TIMEOUT_MSGSEND,NULL);
diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp
index bb8274587b..e743e82bc6 100644
--- a/plugins/Scriver/src/chat/log.cpp
+++ b/plugins/Scriver/src/chat/log.cpp
@@ -33,7 +33,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
if (lstrdat->buffer == NULL) {
lstrdat->bufferOffset = 0;
lstrdat->buffer = pci->Log_CreateRTF(lstrdat);
- lstrdat->bufferLen = lstrlenA(lstrdat->buffer);
+ lstrdat->bufferLen = mir_strlen(lstrdat->buffer);
}
// give the RTF to the RE control
diff --git a/plugins/Scriver/src/chat/message.cpp b/plugins/Scriver/src/chat/message.cpp
index 1bcc285f79..fa228ab895 100644
--- a/plugins/Scriver/src/chat/message.cpp
+++ b/plugins/Scriver/src/chat/message.cpp
@@ -95,7 +95,7 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si)
p1 += 5;
- MoveMemory(pszText, p1, lstrlenA(p1) + 1);
+ MoveMemory(pszText, p1, mir_strlen(p1) + 1);
p1 = pszText;
// iterate through all characters, if rtf control character found then take action
@@ -287,9 +287,9 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si)
// move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
- MoveMemory(p1 + lstrlenA(InsertThis), p1 + iRemoveChars, lstrlenA(p1) - iRemoveChars + 1);
- CopyMemory(p1, InsertThis, lstrlenA(InsertThis));
- p1 += lstrlenA(InsertThis);
+ MoveMemory(p1 + mir_strlen(InsertThis), p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1);
+ CopyMemory(p1, InsertThis, mir_strlen(InsertThis));
+ p1 += mir_strlen(InsertThis);
}
else p1++;
}
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp
index 938130031d..d06a6a8c50 100644
--- a/plugins/Scriver/src/chat/options.cpp
+++ b/plugins/Scriver/src/chat/options.cpp
@@ -465,9 +465,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
SHGetPathFromIDList(idList, tszDirectory);
- lstrcat(tszDirectory, _T("\\"));
+ mir_tstrcat(tszDirectory, _T("\\"));
PathToRelativeT(tszDirectory, tszTemp);
- SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
@@ -544,7 +544,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
free(pszText1);
}
else {
- lstrcpyn(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
+ mir_tstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
db_unset(NULL, CHAT_MODULE, "LogDirectory");
}
pci->SM_InvalidateLogDirectories();
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp
index 5053c2b5d7..7af2a95929 100644
--- a/plugins/Scriver/src/chat/tools.cpp
+++ b/plugins/Scriver/src/chat/tools.cpp
@@ -78,10 +78,10 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s
if (pszWordText)
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
else
- lstrcpyn(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
+ mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
- if (lstrlen(szTemp) > 40)
- lstrcpyn(szTemp + 40, _T("..."), 4);
+ if (mir_tstrlen(szTemp) > 40)
+ mir_tstrncpy(szTemp + 40, _T("..."), 4);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index a383b869f3..0fa3c1485d 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -256,7 +256,7 @@ LBL_SkipEnd:
if (dat->szSearchQuery == NULL) {
dat->szSearchQuery = (TCHAR*)mir_alloc(sizeof(TCHAR)*(end - start + 1));
- lstrcpyn(dat->szSearchQuery, pszText + start, end - start + 1);
+ mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
}
@@ -969,14 +969,14 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
}
else if (wParam == '\b' && si->szSearch[0]) // backspace
- si->szSearch[lstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
else if (wParam < ' ')
break;
else {
TCHAR szNew[2];
szNew[0] = (TCHAR)wParam;
szNew[1] = '\0';
- if (lstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) {
+ if (mir_tstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) {
MessageBeep(MB_OK);
break;
}
@@ -991,7 +991,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
for (int i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!_tcsnicmp(ui->pszNick, si->szSearch, lstrlen(si->szSearch))) {
+ if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETCURSEL, i, 0);
InvalidateRect(hwnd, NULL, FALSE);
return 0;
@@ -1000,7 +1000,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
MessageBeep(MB_OK);
- si->szSearch[lstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
return 0;
}
break;
@@ -1441,7 +1441,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
}
SetTextColor(dis->hDC, ui->iStatusEx == 0 ? g_Settings.crUserListColor : g_Settings.crUserListHeadingsColor);
- TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, lstrlen(ui->pszNick));
+ TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, mir_tstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
}
return TRUE;
@@ -1715,11 +1715,11 @@ LABEL_SHOWWINDOW:
if (GetKeyState(VK_SHIFT) & 0x8000) {
LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
- TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(lstrlen(ui->pszUID) + 3));
+ TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(mir_tstrlen(ui->pszUID) + 3));
if (start == 0)
- mir_sntprintf(pszName, lstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID);
+ mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID);
else
- mir_sntprintf(pszName, lstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
+ mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index 9b306dac6c..f36a1d24f6 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -150,7 +150,7 @@ static int ackevent(WPARAM wParam, LPARAM lParam)
dbei.flags |= DBEF_UTF;
dbei.szModule = GetContactProto(hContact);
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(item->sendBuffer) + 1;
+ dbei.cbBlob = mir_strlen(item->sendBuffer) + 1;
if (!(item->flags & PREF_UTF))
dbei.cbBlob *= sizeof(TCHAR) + 1;
dbei.pBlob = (PBYTE)item->sendBuffer;
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index 41e2227a7a..8c07b4dd28 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -408,8 +408,8 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK *
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1));
- lstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
+ mir_tstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index e471643fc2..596af74bae 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -171,7 +171,7 @@ int RTL_Detect(WCHAR *pszwText)
{
WORD *infoTypeC2;
int i;
- int iLen = lstrlenW(pszwText);
+ int iLen = mir_wstrlen(pszwText);
infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2));
@@ -201,14 +201,14 @@ static void AddToFileList(TCHAR ***pppFiles,int *totalCount,const TCHAR* szFilen
WIN32_FIND_DATA fd;
HANDLE hFind;
TCHAR szPath[MAX_PATH];
- lstrcpy(szPath,szFilename);
- lstrcat(szPath,_T("\\*"));
+ mir_tstrcpy(szPath,szFilename);
+ mir_tstrcat(szPath,_T("\\*"));
if (( hFind = FindFirstFile( szPath, &fd )) != INVALID_HANDLE_VALUE ) {
do {
if ( !lstrcmp(fd.cFileName,_T(".")) || !lstrcmp(fd.cFileName,_T(".."))) continue;
- lstrcpy(szPath,szFilename);
- lstrcat(szPath,_T("\\"));
- lstrcat(szPath,fd.cFileName);
+ mir_tstrcpy(szPath,szFilename);
+ mir_tstrcat(szPath,_T("\\"));
+ mir_tstrcat(szPath,fd.cFileName);
AddToFileList(pppFiles,totalCount,szPath);
}
while( FindNextFile( hFind,&fd ));
@@ -1167,12 +1167,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (dat->windowData.hContact) {
char buf[128];
GetContactUniqueId(dat, buf, sizeof(buf));
- if (!OpenClipboard(hwndDlg) || !lstrlenA(buf))
+ if (!OpenClipboard(hwndDlg) || !mir_strlen(buf))
break;
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(buf) + 1);
- lstrcpyA((LPSTR)GlobalLock(hData), buf);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_strlen(buf) + 1);
+ mir_strcpy((LPSTR)GlobalLock(hData), buf);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
CloseClipboard();
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp
index e6a7d453d0..aa99c773d1 100644
--- a/plugins/Scriver/src/msglog.cpp
+++ b/plugins/Scriver/src/msglog.cpp
@@ -191,7 +191,7 @@ EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, HANDLE hDbEven
if (evt->eventType == EVENTTYPE_FILE) {
char *filename = ((char*)dbei.pBlob) + sizeof(DWORD);
- char *descr = filename + lstrlenA(filename) + 1;
+ char *descr = filename + mir_strlen(filename) + 1;
evt->pszTextT = DbGetEventStringT(&dbei, filename);
if (*descr != 0)
evt->pszText2T = DbGetEventStringT(&dbei, descr);
@@ -428,27 +428,27 @@ TCHAR* TimestampToString(DWORD dwFlags, time_t check, int mode)
today = mktime(&tm_today);
if (dwFlags & SMF_RELATIVEDATE && check >= today) {
- lstrcpy(szResult, TranslateT("Today"));
+ mir_tstrcpy(szResult, TranslateT("Today"));
if (mode == 0)
- lstrcat(szResult, _T(","));
+ mir_tstrcat(szResult, _T(","));
}
else if (dwFlags & SMF_RELATIVEDATE && check > (today - 86400)) {
- lstrcpy(szResult, TranslateT("Yesterday"));
+ mir_tstrcpy(szResult, TranslateT("Yesterday"));
if (mode == 0)
- lstrcat(szResult, _T(","));
+ mir_tstrcat(szResult, _T(","));
}
else {
if (dwFlags & SMF_LONGDATE)
- lstrcpy(format, _T("D"));
+ mir_tstrcpy(format, _T("D"));
else
- lstrcpy(format, _T("d"));
+ mir_tstrcpy(format, _T("d"));
}
}
if (mode == 0 || mode == 2) {
if (mode == 0 && (dwFlags & SMF_SHOWDATE))
- lstrcat(format, _T(" "));
+ mir_tstrcat(format, _T(" "));
- lstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? _T("s") : _T("t"));
+ mir_tstrcat(format, (dwFlags & SMF_SHOWSECONDS) ? _T("s") : _T("t"));
}
if (format[0] != '\0') {
tmi.printTimeStamp(NULL, check, format, str, SIZEOF(str), 0);
@@ -812,7 +812,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
*pcb = 0;
return 0;
}
- dat->bufferLen = lstrlenA(dat->buffer);
+ dat->bufferLen = mir_strlen(dat->buffer);
}
*pcb = min(cb, dat->bufferLen - dat->bufferOffset);
CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 53d2703f72..b0773914c3 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -196,7 +196,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
ptrT tszFace(db_get_tsa(NULL, SRMMMOD, str));
if (tszFace == NULL)
- lstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
+ mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
_tcsncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName));
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index f2e1bc7c86..bd6899a7d7 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -49,12 +49,12 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
isTemplate = 0;
if (hContact && szProto) {
tokens[0] = GetNickname(hContact, szProto);
- tokenLen[0] = lstrlen(tokens[0]);
+ tokenLen[0] = mir_tstrlen(tokens[0]);
tokens[1] = mir_tstrdup(pcli->pfnGetStatusModeDescription(szProto ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE, 0));
- tokenLen[1] = lstrlen(tokens[1]);
+ tokenLen[1] = mir_tstrlen(tokens[1]);
tokens[2] = db_get_tsa(hContact, "CList", "StatusMsg");
if (tokens[2] != NULL) {
- tokenLen[2] = lstrlen(tokens[2]);
+ tokenLen[2] = mir_tstrlen(tokens[2]);
for (i = j = 0; i < tokenLen[2]; i++) {
if (tokens[2][i] == '\r')
continue;
@@ -72,7 +72,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
PROTOACCOUNT* proto = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)accModule);
if (proto != NULL) {
tokens[3] = mir_tstrdup(proto->tszAccountName);
- tokenLen[3] = lstrlen(tokens[3]);
+ tokenLen[3] = mir_tstrlen(tokens[3]);
}
}
tmplt = db_get_tsa(NULL, SRMMMOD, SRMSGSET_WINDOWTITLE);
@@ -100,13 +100,13 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
}
}
if (!isTemplate)
- len += lstrlen(pszNewTitleEnd);
+ len += mir_tstrlen(pszNewTitleEnd);
title = (TCHAR *)mir_alloc(sizeof(TCHAR) * (len + 1));
for (len = 0, p = tmplt; *p; p++) {
if (*p == '%') {
for (i = 0; i < SIZEOF(titleTokenNames); i ++) {
- int tnlen = lstrlen(titleTokenNames[i]);
+ int tnlen = mir_tstrlen(titleTokenNames[i]);
if (!_tcsncmp(p, titleTokenNames[i], tnlen)) {
if (tokens[i] != NULL) {
memcpy(title+len, tokens[i], sizeof(TCHAR) * tokenLen[i]);
@@ -121,8 +121,8 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
title[len++] = *p;
}
if (!isTemplate) {
- memcpy(title+len, pszNewTitleEnd, sizeof(TCHAR) * lstrlen(pszNewTitleEnd));
- len += lstrlen(pszNewTitleEnd);
+ memcpy(title+len, pszNewTitleEnd, sizeof(TCHAR) * mir_tstrlen(pszNewTitleEnd));
+ len += mir_tstrlen(pszNewTitleEnd);
}
title[len] = '\0';
if (isTemplate)
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index f7b158df80..07f033524c 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -187,7 +187,7 @@ char* GetRichTextRTF(HWND hwnd)
void rtrimText(TCHAR *text)
{
static TCHAR szTrimString[] = _T(":;,.!?\'\"><()[]- \r\n");
- int iLen = lstrlen(text)-1;
+ int iLen = mir_tstrlen(text)-1;
while(iLen >= 0 && _tcschr(szTrimString, text[iLen])) {
text[iLen] = _T('\0');
iLen--;
@@ -196,7 +196,7 @@ void rtrimText(TCHAR *text)
TCHAR *limitText(TCHAR *text, int limit)
{
- int len = lstrlen(text);
+ int len = mir_tstrlen(text);
if (len > g_dat.limitNamesLength)
{
TCHAR *ptszTemp = (TCHAR *)mir_alloc(sizeof(TCHAR) * (limit + 4));
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp
index 615ebb5b34..8f432bb761 100644
--- a/plugins/SecureIM/src/commonheaders.cpp
+++ b/plugins/SecureIM/src/commonheaders.cpp
@@ -82,9 +82,9 @@ int msgbox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
void CopyToClipboard(HWND hwnd, LPSTR msg)
{
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(msg) + 1);
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, mir_strlen(msg) + 1);
LPSTR lpstrCopy = (LPSTR)GlobalLock(hglbCopy);
- lstrcpyA(lpstrCopy, msg);
+ mir_strcpy(lpstrCopy, msg);
GlobalUnlock(hglbCopy);
OpenClipboard(NULL);
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp
index 51074118d6..318567cb90 100644
--- a/plugins/SendScreenshotPlus/src/CSend.cpp
+++ b/plugins/SendScreenshotPlus/src/CSend.cpp
@@ -233,15 +233,15 @@ void CSend::svcSendMsgExit(const char* szMessage) {
Exit(res); return;
}else{
mir_freeAndNil(m_szEventMsg);
- m_cbEventMsg=lstrlenA(szMessage)+1;
+ m_cbEventMsg=mir_strlen(szMessage)+1;
m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg);
ZeroMemory(m_szEventMsg, m_cbEventMsg);
- lstrcpyA(m_szEventMsg,szMessage);
+ mir_strcpy(m_szEventMsg,szMessage);
if (m_pszFileDesc && m_pszFileDesc[0] != NULL) {
char *temp = mir_t2a(m_pszFileDesc);
mir_stradd(m_szEventMsg, "\r\n");
mir_stradd(m_szEventMsg, temp);
- m_cbEventMsg = lstrlenA(m_szEventMsg)+1;
+ m_cbEventMsg = mir_strlen(m_szEventMsg)+1;
mir_free(temp);
}
//create a HookEventObj on ME_PROTO_ACK
@@ -272,15 +272,15 @@ void CSend::svcSendFileExit() {
}
mir_freeAndNil(m_szEventMsg);
char* szFile = mir_t2a(m_pszFile);
- m_cbEventMsg=lstrlenA(szFile)+2;
+ m_cbEventMsg=mir_strlen(szFile)+2;
m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg);
ZeroMemory(m_szEventMsg, m_cbEventMsg);
- lstrcpyA(m_szEventMsg,szFile);
+ mir_strcpy(m_szEventMsg,szFile);
if (m_pszFileDesc && m_pszFileDesc[0] != NULL) {
char* temp = mir_t2a(m_pszFileDesc);
- m_cbEventMsg += lstrlenA(temp);
+ m_cbEventMsg += mir_strlen(temp);
m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg);
- lstrcpyA(m_szEventMsg+lstrlenA(szFile)+1,temp);
+ mir_strcpy(m_szEventMsg+mir_strlen(szFile)+1,temp);
m_szEventMsg[m_cbEventMsg-1] = 0;
mir_free(temp);
}
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp
index 24e1cdc736..c8e840cc48 100644
--- a/plugins/ShellExt/src/main.cpp
+++ b/plugins/ShellExt/src/main.cpp
@@ -128,7 +128,7 @@ STDAPI DllRegisterServer()
TCHAR tszFileName[MAX_PATH];
GetModuleFileName(hInst, tszFileName, SIZEOF(tszFileName));
- if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(TCHAR)*(lstrlen(tszFileName)+1)))
+ if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(TCHAR)*(mir_tstrlen(tszFileName)+1)))
return E_FAIL;
if ( RegSetValueExA(kInprocServer, "ThreadingModel", 0, REG_SZ, (PBYTE)str4, sizeof(str4)))
return E_FAIL;
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp
index 2908263d46..5d200019bb 100644
--- a/plugins/ShellExt/src/shlcom.cpp
+++ b/plugins/ShellExt/src/shlcom.cpp
@@ -79,21 +79,21 @@ BOOL AddToList(TAddArgList& args)
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
// add the directory
- lstrcpyA(szBuf, args.szFile);
+ mir_strcpy(szBuf, args.szFile);
args.files = (LPSTR*)mir_realloc(args.files, (args.count + 1) * sizeof(LPSTR));
char *p = mir_strdup(szBuf);
args.files[args.count] = p;
args.count++;
// tack on ending search token
- lstrcatA(szBuf, "\\*");
+ mir_strcat(szBuf, "\\*");
WIN32_FIND_DATAA fd;
HANDLE hFind = FindFirstFileA(szBuf, &fd);
while (true) {
if (fd.cFileName[0] != '.') {
- lstrcpyA(szBuf, args.szFile);
- lstrcatA(szBuf, "\\");
- lstrcatA(szBuf, fd.cFileName);
+ mir_strcpy(szBuf, args.szFile);
+ mir_strcat(szBuf, "\\");
+ mir_strcat(szBuf, fd.cFileName);
// keep a copy of the current thing being processed
szThis = args.szFile;
args.szFile = szBuf;
@@ -200,8 +200,8 @@ void ipcGetSkinIcons(THeaderIPC *ipch)
spi.pid = GetCurrentProcessId();
while (protoCount > 0) {
PROTOACCOUNT *pa = *pp;
- lstrcpyA(szTmp, pa->szModuleName);
- lstrcatA(szTmp, PS_GETCAPS);
+ mir_strcpy(szTmp, pa->szModuleName);
+ mir_strcat(szTmp, PS_GETCAPS);
DWORD dwCaps = CallService(szTmp, PFLAGNUM_1, 0);
if (dwCaps & PF1_FILESEND) {
TSlotIPC *pct = ipcAlloc(ipch, sizeof(TSlotProtoIcons));
@@ -315,9 +315,9 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
if (bGroupMode) {
rc = db_get_s(pContacts[i].hContact, "CList", "Group", &dbv);
if (!rc)
- n = lstrlenA(dbv.pszVal) + 1;
+ n = mir_strlen(dbv.pszVal) + 1;
}
- int cch = lstrlenA(szContact) + 1;
+ int cch = mir_strlen(szContact) + 1;
TSlotIPC *pct = ipcAlloc(ipch, cch + 1 + n);
if (pct == NULL) {
db_free(&dbv);
@@ -326,7 +326,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
// lie about the actual size of the TSlotIPC
pct->cbStrSection = cch;
LPSTR szSlot = LPSTR(pct) + sizeof(TSlotIPC);
- lstrcpyA(szSlot, szContact);
+ mir_strcpy(szSlot, szContact);
pct->fType = REQUEST_CONTACTS;
pct->hContact = pContacts[i].hContact;
pct->Status = pContacts[i].dwStatus;
@@ -337,7 +337,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
szSlot += cch + 1;
if (rc == 0) {
pct->hGroup = murmur_hash(dbv.pszVal);
- lstrcpyA(szSlot, dbv.pszVal);
+ mir_strcpy(szSlot, dbv.pszVal);
db_free(&dbv);
}
else {
@@ -415,15 +415,15 @@ void __stdcall ipcService(ULONG_PTR dwParam)
// see if we have a custom string for 'Miranda'
szMiranda = "Miranda";
- lstrcpynA(pMMT->MirandaName, szMiranda, sizeof(pMMT->MirandaName) - 1);
+ mir_strncpy(pMMT->MirandaName, szMiranda, sizeof(pMMT->MirandaName) - 1);
// for the MRU menu
szBuf = Translate("Recently");
- lstrcpynA(pMMT->MRUMenuName, szBuf, sizeof(pMMT->MRUMenuName) - 1);
+ mir_strncpy(pMMT->MRUMenuName, szBuf, sizeof(pMMT->MRUMenuName) - 1);
// and a custom string for "clear entries"
szBuf = Translate("Clear entries");
- lstrcpynA(pMMT->ClearEntries, szBuf, sizeof(pMMT->ClearEntries) - 1);
+ mir_strncpy(pMMT->ClearEntries, szBuf, sizeof(pMMT->ClearEntries) - 1);
// if the group mode is on, check if they want the CList setting
bool bGroupMode = (BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseGroups, BST_UNCHECKED));
@@ -449,7 +449,7 @@ void __stdcall ipcService(ULONG_PTR dwParam)
_itoa(iSlot, szGroupStr, 10);
if ( db_get_s(0, "CListGroups", szGroupStr, &dbv) != 0)
break;
- pct = ipcAlloc(pMMT, lstrlenA(dbv.pszVal + 1) + 1);
+ pct = ipcAlloc(pMMT, mir_strlen(dbv.pszVal + 1) + 1);
// first byte has flags, need null term
if (pct != NULL) {
if (pMMT->GroupsBegin == NULL)
@@ -457,7 +457,7 @@ void __stdcall ipcService(ULONG_PTR dwParam)
pct->fType = REQUEST_GROUPS;
pct->hContact = 0;
szBuf = LPSTR(pct) + sizeof(TSlotIPC); // get the end of the slot
- lstrcpyA(szBuf, dbv.pszVal + 1);
+ mir_strcpy(szBuf, dbv.pszVal + 1);
pct->hGroup = 0;
db_free(&dbv); // free the string
}
diff --git a/plugins/ShellExt/src/shlext.cpp b/plugins/ShellExt/src/shlext.cpp
index ff8ba3d906..702f072fe4 100644
--- a/plugins/ShellExt/src/shlext.cpp
+++ b/plugins/ShellExt/src/shlext.cpp
@@ -169,7 +169,7 @@ void DecideMenuItemInfo(TSlotIPC *pct, TGroupNode *pg, MENUITEMINFOA &mii, TEnum
if (pct != NULL) {
psd->cch = pct->cbStrSection - 1; // no null;
psd->szText = (char*)HeapAlloc(hDllHeap, 0, pct->cbStrSection);
- lstrcpyA(psd->szText, (char*)pct + sizeof(TSlotIPC));
+ mir_strcpy(psd->szText, (char*)pct + sizeof(TSlotIPC));
psd->hContact = pct->hContact;
psd->fTypes = dtContact;
// find the protocol icon array to use && which status
@@ -375,9 +375,9 @@ static void BuildMenus(TEnumData *lParam)
// since it maybe Miranda\Blah\Blah and we have created the first node
// which maybe Miranda, thus giving the wrong hash
// since "Miranda" can be a group of it's own and a full path
- q->cchGroup = lstrlenA(Token);
+ q->cchGroup = mir_strlen(Token);
q->szGroup = (LPSTR)HeapAlloc(hDllHeap, 0, q->cchGroup + 1);
- lstrcpyA(q->szGroup, Token);
+ mir_strcpy(q->szGroup, Token);
q->dwItems = 0;
}
p = q;
@@ -449,7 +449,7 @@ static void BuildMenus(TEnumData *lParam)
// the IPC string pointer wont be around forever, must make a copy
psd->cch = (int)strlen(lParam->ipch->MRUMenuName);
psd->szText = (LPSTR)HeapAlloc(hDllHeap, 0, psd->cch + 1);
- lstrcpynA(psd->szText, lParam->ipch->MRUMenuName, sizeof(lParam->ipch->MRUMenuName) - 1);
+ mir_strncpy(psd->szText, lParam->ipch->MRUMenuName, sizeof(lParam->ipch->MRUMenuName) - 1);
mii.dwItemData = (LPARAM)psd;
if (lParam->bOwnerDrawSupported && lParam->bShouldOwnerDraw) {
@@ -486,13 +486,13 @@ static void BuildMenus(TEnumData *lParam)
psd = (TMenuDrawInfo*)HeapAlloc(hDllHeap, 0, sizeof(TMenuDrawInfo));
psd->cch = (int)strlen(lParam->ipch->MirandaName);
psd->szText = (LPSTR)HeapAlloc(hDllHeap, 0, psd->cch + 1);
- lstrcpynA(psd->szText, lParam->ipch->MirandaName, sizeof(lParam->ipch->MirandaName) - 1);
+ mir_strncpy(psd->szText, lParam->ipch->MirandaName, sizeof(lParam->ipch->MirandaName) - 1);
// there may not be a profile name
pg = lParam->ipch->DataPtr;
psd->szProfile = NULL;
if (pg != NULL && pg->Status == STATUS_PROFILENAME) {
psd->szProfile = (LPSTR)HeapAlloc(hDllHeap, 0, pg->cbStrSection);
- lstrcpyA(psd->szProfile, LPSTR(UINT_PTR(pg) + sizeof(TSlotIPC)));
+ mir_strcpy(psd->szProfile, LPSTR(UINT_PTR(pg) + sizeof(TSlotIPC)));
}
// owner draw menus need ID's
@@ -771,7 +771,7 @@ HRESULT RequestTransfer(TShellExt *Self, int idxCmd)
THeaderIPC *pipch = (THeaderIPC*)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
if (pipch != NULL) {
// create the name of the object to be signalled by the ST
- lstrcpyA(pipch->SignalEventName, CreateUID(szBuf, sizeof(szBuf)));
+ mir_strcpy(pipch->SignalEventName, CreateUID(szBuf, sizeof(szBuf)));
// create it
HANDLE hReply = CreateEventA(NULL, false, false, pipch->SignalEventName);
if (hReply != 0) {
@@ -868,7 +868,7 @@ HRESULT TShellExt::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESU
GetTextExtentPoint32A(dwi->hDC, psd->szText, psd->cch, &tS);
dwi->rcItem.left += tS.cx + 8;
SetTextColor(dwi->hDC, GetSysColor(COLOR_GRAYTEXT));
- DrawTextA(dwi->hDC, psd->szProfile, lstrlenA(psd->szProfile), &dwi->rcItem, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ DrawTextA(dwi->hDC, psd->szProfile, mir_strlen(psd->szProfile), &dwi->rcItem, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
}
}
else {
@@ -914,7 +914,7 @@ HRESULT TShellExt::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESU
dx += tS.cx;
// main menu item?
if (psd->szProfile != NULL) {
- GetTextExtentPoint32A(hMemDC, psd->szProfile, lstrlenA(psd->szProfile), &tS);
+ GetTextExtentPoint32A(hMemDC, psd->szProfile, mir_strlen(psd->szProfile), &tS);
dx += tS.cx;
}
// store it
diff --git a/plugins/ShellExt/src/utils.cpp b/plugins/ShellExt/src/utils.cpp
index 22e033fb42..1a71ca3fe8 100644
--- a/plugins/ShellExt/src/utils.cpp
+++ b/plugins/ShellExt/src/utils.cpp
@@ -20,7 +20,7 @@ void logA(const char *format, ...)
UINT murmur_hash(const char *str)
{
- size_t len = lstrlenA(str);
+ size_t len = mir_strlen(str);
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index ec16743b2f..d92b88e851 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -273,7 +273,7 @@ INT addEvent(WPARAM hContact, LPARAM lParam)
dbei.flags = DBEF_UTF | DBEF_SENT; //DBEF_READ;
dbei.szModule = pszProto;
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(pszUtf) + 1;
+ dbei.cbBlob = mir_strlen(pszUtf) + 1;
dbei.pBlob = (PBYTE)pszUtf;
db_event_add(hContact, &dbei);
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index ab93e8b13f..84a8acda74 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -44,7 +44,7 @@ static char *StrNormNewlineA(char *szStr)
if (!nCR)
return mir_strdup(szStr);
- char *szNewStr = (char *)mir_alloc(lstrlenA(szStr) + nCR + 1), *pszStr = szNewStr;
+ char *szNewStr = (char *)mir_alloc(mir_strlen(szStr) + nCR + 1), *pszStr = szNewStr;
while (*szStr) {
if (*szStr == 0x0A)
*pszStr++ = 0x0D;
@@ -69,7 +69,7 @@ static TCHAR *StrNormNewline(TCHAR *tszStr)
if (!nCR)
return mir_tstrdup(tszStr);
- TCHAR *tszNewStr = (TCHAR *)mir_alloc((lstrlen(tszStr) + nCR + 1) * sizeof(TCHAR)), *ptszStr = tszNewStr;
+ TCHAR *tszNewStr = (TCHAR *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(TCHAR)), *ptszStr = tszNewStr;
while (*tszStr) {
if (*tszStr == 0x0A)
*ptszStr++ = 0x0D;
@@ -268,7 +268,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
TCHAR *tszMsg = StrNormNewline((TCHAR *)ack->lParam);
mir_sntprintf(msg, SIZEOF(msg), _T("%s"), tszMsg);
mir_free(tszMsg);
- size_t len = lstrlen(msg);
+ size_t len = mir_tstrlen(msg);
if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
@@ -351,7 +351,7 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam)
char *szMsgURL = (char *)mir_alloc(i + 1);
if (szMsgURL) {
- lstrcpynA(szMsgURL, szURL, i + 1);
+ mir_strncpy(szMsgURL, szURL, i + 1);
CallService(MS_UTILS_OPENURL, 1, (LPARAM)szMsgURL);
mir_free(szMsgURL);
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index d514176267..bbf0c7fcef 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -163,7 +163,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
if (i + 2 <= 1024 && msg[i + 2])
{
count++;
- MoveMemory(p, p + 1, (lstrlen(p) - 1) * sizeof(TCHAR));
+ MoveMemory(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(TCHAR));
}
else
{
@@ -194,11 +194,11 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
else
continue;
- if (lstrlen(ptszWinampTitle) > 12)
- msg = (TCHAR *)mir_realloc(msg, (lstrlen(msg) + 1 + lstrlen(ptszWinampTitle) - 12) * sizeof(TCHAR));
+ if (mir_tstrlen(ptszWinampTitle) > 12)
+ msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(TCHAR));
- MoveMemory(msg + i + lstrlen(ptszWinampTitle), msg + i + 12, (lstrlen(msg) - i - 11) * sizeof(TCHAR));
- CopyMemory(msg + i, ptszWinampTitle, lstrlen(ptszWinampTitle) * sizeof(TCHAR));
+ MoveMemory(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
+ CopyMemory(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(TCHAR));
mir_free(ptszWinampTitle);
}
@@ -229,21 +229,21 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
}
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, SIZEOF(substituteStr));
- if (lstrlen(substituteStr) > 6)
- msg = (TCHAR *)mir_realloc(msg, (lstrlen(msg) + 1 + lstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > 6)
+ msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
- MoveMemory(msg + i + lstrlen(substituteStr), msg + i + 6, (lstrlen(msg) - i - 5) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
+ CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
else if (!_tcsnicmp(msg + i, _T("%date%"), 6))
{
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, SIZEOF(substituteStr));
- if (lstrlen(substituteStr) > 6)
- msg = (TCHAR *)mir_realloc(msg, (lstrlen(msg) + 1 + lstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > 6)
+ msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
- MoveMemory(msg + i + lstrlen(substituteStr), msg + i + 6, (lstrlen(msg) - i - 5) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
+ CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
else if (!_tcsnicmp(msg+i, _T("%rand("), 6))
{
@@ -261,11 +261,11 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
mir_sntprintf(substituteStr, SIZEOF(substituteStr), _T("%d"), GetRandom(ran_from, ran_to));
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
- if (lstrlen(substituteStr) > k - i)
- msg = (TCHAR *)mir_realloc(msg, (lstrlen(msg) + 1 + lstrlen(substituteStr) - (k - i)) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > k - i)
+ msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(TCHAR));
- MoveMemory(msg + i + lstrlen(substituteStr), msg + i + (k - i), (lstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR));
+ CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
mir_free(temp);
}
@@ -296,12 +296,12 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
db_free(&dbv);
continue;
}
- lstrcpy(substituteStr, dbv.ptszVal);
+ mir_tstrcpy(substituteStr, dbv.ptszVal);
db_free(&dbv);
}
else continue;
- if (!lstrlen(substituteStr)) continue;
+ if (!mir_tstrlen(substituteStr)) continue;
if (_tcsstr(substituteStr, _T("%randmsg%")) != NULL || _tcsstr(substituteStr, _T("%randdefmsg%")) != NULL)
{
if (k == maxk) maxk--;
@@ -309,13 +309,13 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
else rmark[0] = TRUE;
}
- if (k2 == maxk || k2 > maxk) lstrcpy(substituteStr, _T(""));
+ if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, _T(""));
- if (lstrlen(substituteStr) > 9)
- msg = (TCHAR *)mir_realloc(msg, (lstrlen(msg) + 1 + lstrlen(substituteStr) - 9) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > 9)
+ msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(TCHAR));
- MoveMemory(msg + i + lstrlen(substituteStr), msg + i + 9, (lstrlen(msg) - i - 8) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(TCHAR));
+ CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
else if (!_tcsnicmp(msg+i, _T("%randdefmsg%"), 12))
{
@@ -344,12 +344,12 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
db_free(&dbv);
continue;
}
- lstrcpy(substituteStr, dbv.ptszVal);
+ mir_tstrcpy(substituteStr, dbv.ptszVal);
db_free(&dbv);
}
else continue;
- if (!lstrlen(substituteStr)) continue;
+ if (!mir_tstrlen(substituteStr)) continue;
if (_tcsstr(substituteStr, _T("%randmsg%")) != NULL || _tcsstr(substituteStr, _T("%randdefmsg%")) != NULL)
{
if (k == maxk) maxk--;
@@ -357,24 +357,24 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
else rmark[0] = TRUE;
}
- if (k2 == maxk || k2 > maxk) lstrcpy(substituteStr, _T(""));
+ if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, _T(""));
- if (lstrlen(substituteStr) > 12)
- msg = (TCHAR *)mir_realloc(msg, (lstrlen(msg)+1+lstrlen(substituteStr)-12) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > 12)
+ msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(TCHAR));
- MoveMemory(msg + i + lstrlen(substituteStr), msg + i + 12, (lstrlen(msg) - i - 11) * sizeof(TCHAR));
- CopyMemory(msg + i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
+ CopyMemory(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
}
- if (count) msg[lstrlen(msg) - count] = 0;
+ if (count) msg[mir_tstrlen(msg) - count] = 0;
if (szProto)
{
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", szProto);
len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
- if (len < lstrlen(msg))
+ if (len < mir_tstrlen(msg))
{
msg = (TCHAR *)mir_realloc(msg, len * sizeof(TCHAR));
msg[len] = 0;
@@ -467,7 +467,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
void DBWriteMessage(char *szSetting, TCHAR *tszMsg)
{
- if (tszMsg && lstrlen(tszMsg))
+ if (tszMsg && mir_tstrlen(tszMsg))
db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
else
db_unset(NULL, "SimpleStatusMsg", szSetting);
@@ -1401,7 +1401,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d
db_free(&dbv);
}
- if (tszMsg && lstrlen(tszMsg))
+ if (tszMsg && mir_tstrlen(tszMsg))
{
#ifdef _DEBUG
log2file("UpdateMsgTimerProc(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iCurrentStatus, ""), tszMsg, accounts->pa[i]->szModuleName);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index 487d575ca8..f0b8941f09 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -335,7 +335,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i);
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) {
if (dbv.ptszVal) {
- if (!lstrlen(dbv.ptszVal)) {
+ if (!mir_tstrlen(dbv.ptszVal)) {
db_free(&dbv);
continue;
}
@@ -472,7 +472,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control)
int len;
GetMenuString(hmenu, m_selection, (LPTSTR)&item_string, 128, MF_BYCOMMAND);
- len = lstrlen(item_string);
+ len = mir_tstrlen(item_string);
if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
@@ -722,7 +722,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) {
if (dbv.pszVal && strlen(dbv.pszVal)) {
if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2)) {
- if (dbv2.ptszVal && lstrlen(dbv2.ptszVal)) {
+ if (dbv2.ptszVal && mir_tstrlen(dbv2.ptszVal)) {
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv2.ptszVal);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)dbv2.ptszVal);
if (fcursel != CB_ERR)
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp
index 5ad595fc8a..e6b48a54a3 100644
--- a/plugins/SimpleStatusMsg/src/options.cpp
+++ b/plugins/SimpleStatusMsg/src/options.cpp
@@ -138,7 +138,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val;
ptrT text( db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
- lstrcpyn(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
+ mir_tstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
for (j = 0; j < accounts->count; j++)
{
@@ -150,7 +150,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
mir_snprintf(setting, SIZEOF(setting), "%sDefault", accounts->pa[j]->szModuleName);
text = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, setting));
- lstrcpyn(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
+ mir_tstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
}
}
}
@@ -453,7 +453,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
- if ((dbv2.ptszVal) && (lstrlen(dbv2.ptszVal)))
+ if ((dbv2.ptszVal) && (mir_tstrlen(dbv2.ptszVal)))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
db_free(&dbv2);
@@ -608,7 +608,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
- if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
+ if (dbv2.ptszVal && mir_tstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
db_free(&dbv2);
}
@@ -708,7 +708,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
- if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
+ if (dbv2.ptszVal && mir_tstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
db_free(&dbv2);
}
@@ -822,7 +822,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
- if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
+ if (dbv2.ptszVal && mir_tstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
db_free(&dbv2);
}
@@ -901,7 +901,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
else
{
GetDlgItemText(hwndDlg, IDC_OPTEDIT1, msg, SIZEOF(msg));
- lstrcpy(data->status_msg[j].msg[i], msg);
+ mir_tstrcpy(data->status_msg[j].msg[i], msg);
}
}
break;
@@ -924,7 +924,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
data->status_msg[0].flags[i-ID_STATUS_ONLINE] = data->status_msg[j].flags[i-ID_STATUS_ONLINE];
if (data->status_msg[j].flags[i-ID_STATUS_ONLINE] & STATUS_THIS_MSG)
- lstrcpy(data->status_msg[0].msg[i-ID_STATUS_ONLINE], data->status_msg[j].msg[i-ID_STATUS_ONLINE]);
+ mir_tstrcpy(data->status_msg[0].msg[i-ID_STATUS_ONLINE], data->status_msg[j].msg[i-ID_STATUS_ONLINE]);
}
}
}
@@ -942,7 +942,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
if (data->proto_msg[j].flags & PROTO_THIS_MSG)
{
- int len = lstrlen(data->proto_msg[j].msg);
+ int len = mir_tstrlen(data->proto_msg[j].msg);
if (len > 0)
{
if (data->proto_msg[k+1].msg == NULL)
@@ -970,7 +970,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
data->status_msg[k + 1].flags[i - ID_STATUS_ONLINE] = data->status_msg[j].flags[i - ID_STATUS_ONLINE];
if (data->status_msg[j].flags[i - ID_STATUS_ONLINE] & STATUS_THIS_MSG)
- lstrcpy(data->status_msg[k + 1].msg[i - ID_STATUS_ONLINE], data->status_msg[j].msg[i - ID_STATUS_ONLINE]);
+ mir_tstrcpy(data->status_msg[k + 1].msg[i - ID_STATUS_ONLINE], data->status_msg[j].msg[i - ID_STATUS_ONLINE]);
}
}
}
@@ -997,7 +997,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
data->status_msg[j].flags[k - ID_STATUS_ONLINE] = data->status_msg[j].flags[i];
if (data->status_msg[j].flags[i] & STATUS_THIS_MSG)
- lstrcpy(data->status_msg[j].msg[k - ID_STATUS_ONLINE], data->status_msg[j].msg[i]);
+ mir_tstrcpy(data->status_msg[j].msg[k - ID_STATUS_ONLINE], data->status_msg[j].msg[i]);
}
}
break;
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp
index c342fe1a0d..1f6d928d95 100644
--- a/plugins/SmileyAdd/src/download.cpp
+++ b/plugins/SmileyAdd/src/download.cpp
@@ -210,7 +210,7 @@ void GetSmileyCacheFolder(void)
FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, _T(""));
HookEvent(ME_FOLDERS_PATH_CHANGED, FolderChanged);
}
- else lstrcpyn(cachepath, VARST( _T("%miranda_userdata%\\SmileyCache")), MAX_PATH);
+ else mir_tstrncpy(cachepath, VARST( _T("%miranda_userdata%\\SmileyCache")), MAX_PATH);
}
void DownloadInit(void)
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index 3bf0895ab3..3c9a5df1af 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -490,12 +490,12 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item)
TCHAR filter[512], *pfilter;
_tcscpy(filter, TranslateT("Smiley packs"));
- lstrcat(filter, _T(" (*.msl;*.asl;*.xep)"));
+ mir_tstrcat(filter, _T(" (*.msl;*.asl;*.xep)"));
pfilter = filter + _tcslen(filter) + 1;
_tcscpy(pfilter, _T("*.msl;*.asl;*.xep"));
pfilter = pfilter + _tcslen(pfilter) + 1;
_tcscpy(pfilter, TranslateT("All files"));
- lstrcat(pfilter, _T(" (*.*)"));
+ mir_tstrcat(pfilter, _T(" (*.*)"));
pfilter = pfilter + _tcslen(pfilter) + 1;
_tcscpy(pfilter, _T("*.*"));
pfilter = pfilter + _tcslen(pfilter) + 1;
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp
index 7971b607fd..1dca488f08 100644
--- a/plugins/SpellChecker/src/RichEdit.cpp
+++ b/plugins/SpellChecker/src/RichEdit.cpp
@@ -238,7 +238,7 @@ void RichEdit::ReplaceSel(const TCHAR *new_text)
SuspendUndo();
- FixSel(&old_sel, sel, lstrlen(new_text));
+ FixSel(&old_sel, sel, mir_tstrlen(new_text));
SendMessage(WM_SETREDRAW, FALSE, 0);
SendMessage(EM_SETEVENTMASK, 0, old_mask & ~ENM_CHANGE);
@@ -254,7 +254,7 @@ int RichEdit::Replace(int start, int end, const TCHAR *new_text)
ReplaceSel(new_text);
- int dif = FixSel(&sel, replace_sel, lstrlen(new_text));
+ int dif = FixSel(&sel, replace_sel, mir_tstrlen(new_text));
SetSel(sel);
return dif;
}
@@ -267,7 +267,7 @@ int RichEdit::Insert(int pos, const TCHAR *text)
ReplaceSel(text);
- int dif = FixSel(&sel, replace_sel, lstrlen(text));
+ int dif = FixSel(&sel, replace_sel, mir_tstrlen(text));
SetSel(sel);
return dif;
}
diff --git a/plugins/SpellChecker/src/ardialog.cpp b/plugins/SpellChecker/src/ardialog.cpp
index 22634c8858..1bf94a01f6 100644
--- a/plugins/SpellChecker/src/ardialog.cpp
+++ b/plugins/SpellChecker/src/ardialog.cpp
@@ -217,7 +217,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
TCHAR find[256];
if (data->findReadOnly)
- lstrcpyn(find, data->find.c_str(), SIZEOF(find));
+ mir_tstrncpy(find, data->find.c_str(), SIZEOF(find));
else {
GetDlgItemText(hwndDlg, IDC_OLD, find, SIZEOF(find));
lstrtrim(find);
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp
index aa38708d8a..a3a8425844 100644
--- a/plugins/SpellChecker/src/autoreplace.cpp
+++ b/plugins/SpellChecker/src/autoreplace.cpp
@@ -33,7 +33,7 @@ AutoReplacement::AutoReplacement(const TCHAR *replace, BOOL useVariables)
AutoReplaceMap::AutoReplaceMap(TCHAR *aFilename, Dictionary *dict)
{
this->dict = dict;
- lstrcpyn(filename, aFilename, SIZEOF(filename));
+ mir_tstrncpy(filename, aFilename, SIZEOF(filename));
loadAutoReplaceMap();
}
@@ -145,7 +145,7 @@ TCHAR* AutoReplaceMap::autoReplace(const TCHAR * word)
to = _tcsdup(ar.replace.c_str());
// Wich case to use?
- size_t len = lstrlen(word);
+ size_t len = mir_tstrlen(word);
size_t i;
for (i = 0; i < len; i++)
if (IsCharLower(word[i]))
@@ -169,7 +169,7 @@ TCHAR* AutoReplaceMap::autoReplace(const TCHAR * word)
TCHAR* AutoReplaceMap::filterText(const TCHAR *find)
{
TCHAR *ret = _tcsdup(find);
- int len = lstrlen(ret);
+ int len = mir_tstrlen(ret);
int pos = 0;
for (int i = 0; i < len; i++)
if (isWordChar(find[i]))
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp
index 0926273837..c794aca5f8 100644
--- a/plugins/SpellChecker/src/dictionary.cpp
+++ b/plugins/SpellChecker/src/dictionary.cpp
@@ -443,13 +443,13 @@ protected:
public:
HunspellDictionary(TCHAR *aLanguage, TCHAR *aFileWithoutExtension, TCHAR *anUserPath, TCHAR *aSource)
{
- lstrcpyn(language, aLanguage, SIZEOF(language));
- lstrcpyn(fileWithoutExtension, aFileWithoutExtension, SIZEOF(fileWithoutExtension));
- lstrcpyn(userPath, anUserPath, SIZEOF(userPath));
+ mir_tstrncpy(language, aLanguage, SIZEOF(language));
+ mir_tstrncpy(fileWithoutExtension, aFileWithoutExtension, SIZEOF(fileWithoutExtension));
+ mir_tstrncpy(userPath, anUserPath, SIZEOF(userPath));
if (aSource == NULL)
source[0] = _T('\0');
else
- lstrcpyn(source, aSource, SIZEOF(source));
+ mir_tstrncpy(source, aSource, SIZEOF(source));
loaded = LANGUAGE_NOT_LOADED;
localized_name[0] = _T('\0');
@@ -471,14 +471,14 @@ public:
TCHAR * merge(TCHAR * s1, TCHAR *s2)
{
- int len1 = (s1 == NULL ? 0 : lstrlen(s1));
- int len2 = (s2 == NULL ? 0 : lstrlen(s2));
+ int len1 = (s1 == NULL ? 0 : mir_tstrlen(s1));
+ int len2 = (s2 == NULL ? 0 : mir_tstrlen(s2));
TCHAR *ret;
if (len1 > 0 && len2 > 0) {
ret = (TCHAR *)malloc(sizeof(TCHAR) * (len1 + len2 + 1));
- lstrcpyn(ret, s1, len1 + 1);
- lstrcpyn(&ret[len1], s2, len2 + 1);
+ mir_tstrncpy(ret, s1, len1 + 1);
+ mir_tstrncpy(&ret[len1], s2, len2 + 1);
FREE(s1);
FREE(s2);
@@ -500,7 +500,7 @@ public:
}
// Remove duplicated chars
- int last = lstrlen(ret) - 1;
+ int last = mir_tstrlen(ret) - 1;
for (int i = 0; i <= last; i++) {
TCHAR c = ret[i];
for (int j = last; j > i; j--) {
@@ -757,9 +757,9 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
if (country[0] != 0)
mir_sntprintf(name, SIZEOF(name), _T("%s (%s)"), dict->english_name, country);
else
- lstrcpyn(name, dict->english_name, SIZEOF(name));
+ mir_tstrncpy(name, dict->english_name, SIZEOF(name));
- lstrcpyn(dict->localized_name, TranslateTS(name), SIZEOF(dict->localized_name));
+ mir_tstrncpy(dict->localized_name, TranslateTS(name), SIZEOF(dict->localized_name));
}
if (dict->localized_name[0] != 0) {
@@ -787,14 +787,14 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
char lang[128];
WideCharToMultiByte(CP_ACP, 0, dict->language, -1, lang, sizeof(lang), NULL, NULL);
if (!db_get_ts(NULL, MODULE_NAME, lang, &dbv)) {
- lstrcpyn(dict->localized_name, dbv.ptszVal, SIZEOF(dict->localized_name));
+ mir_tstrncpy(dict->localized_name, dbv.ptszVal, SIZEOF(dict->localized_name));
db_free(&dbv);
}
if (dict->localized_name[0] == _T('\0')) {
for (size_t j = 0; j < SIZEOF(aditionalLanguages); j++) {
if (!lstrcmp(aditionalLanguages[j].language, dict->language)) {
- lstrcpyn(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), SIZEOF(dict->localized_name));
+ mir_tstrncpy(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), SIZEOF(dict->localized_name));
break;
}
}
@@ -804,7 +804,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
mir_sntprintf(dict->full_name, SIZEOF(dict->full_name), _T("%s [%s]"), dict->localized_name, dict->language);
}
else {
- lstrcpyn(dict->full_name, dict->language, SIZEOF(dict->full_name));
+ mir_tstrncpy(dict->full_name, dict->language, SIZEOF(dict->full_name));
}
}
}
@@ -831,17 +831,17 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
continue;
// See if .aff exists too
- lstrcpy(&file[lstrlen(file) - 4], _T(".aff"));
+ mir_tstrcpy(&file[mir_tstrlen(file) - 4], _T(".aff"));
attrib = GetFileAttributes(file);
if (attrib == 0xFFFFFFFF || (attrib & FILE_ATTRIBUTE_DIRECTORY))
continue;
- ffd.cFileName[lstrlen(ffd.cFileName) - 4] = _T('\0');
+ ffd.cFileName[mir_tstrlen(ffd.cFileName) - 4] = _T('\0');
TCHAR *lang = ffd.cFileName;
// Replace - for _
- for (int i = 0; i < lstrlen(lang); i++)
+ for (int i = 0; i < mir_tstrlen(lang); i++)
if (lang[i] == _T('-'))
lang[i] = _T('_');
@@ -853,7 +853,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
if (!exists) {
found = TRUE;
- file[lstrlen(file) - 4] = _T('\0');
+ file[mir_tstrlen(file) - 4] = _T('\0');
dicts.insert(new HunspellDictionary(lang, file, user_path, source));
}
}
diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp
index cba883cb3a..99f9348962 100644
--- a/plugins/SpellChecker/src/options.cpp
+++ b/plugins/SpellChecker/src/options.cpp
@@ -95,7 +95,7 @@ void LoadOptions()
DBVARIANT dbv;
if (!db_get_ts(NULL, MODULE_NAME, "DefaultLanguage", &dbv)) {
- lstrcpyn(opts.default_language, dbv.ptszVal, SIZEOF(opts.default_language));
+ mir_tstrncpy(opts.default_language, dbv.ptszVal, SIZEOF(opts.default_language));
db_free(&dbv);
}
@@ -105,7 +105,7 @@ void LoadOptions()
break;
if (i >= languages.getCount())
- lstrcpy(opts.default_language, languages[0]->language);
+ mir_tstrcpy(opts.default_language, languages[0]->language);
}
static void DrawItem(HWND hwndDlg, LPDRAWITEMSTRUCT lpdis, Dictionary *dict)
@@ -152,7 +152,7 @@ static void DrawItem(HWND hwndDlg, LPDRAWITEMSTRUCT lpdis, Dictionary *dict)
rc.right = lpdis->rcItem.right - 2;
rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2;
rc.bottom = rc.top + tm.tmHeight;
- DrawText(lpdis->hDC, dict->full_name, lstrlen(dict->full_name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+ DrawText(lpdis->hDC, dict->full_name, mir_tstrlen(dict->full_name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
// Restore old colors
SetTextColor(lpdis->hDC, clrfore);
@@ -215,7 +215,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
sel = 0;
db_set_ts(NULL, MODULE_NAME, "DefaultLanguage",
(TCHAR *) languages[sel]->language);
- lstrcpy(opts.default_language, languages[sel]->language);
+ mir_tstrcpy(opts.default_language, languages[sel]->language);
}
}
break;
@@ -329,7 +329,7 @@ static void SaveNewReplacements(BOOL canceled, Dictionary *dict,
AutoreplaceData *data = (AutoreplaceData *) param;
- if (lstrlen(original_find) > 0)
+ if (mir_tstrlen(original_find) > 0)
data->RemoveWord(original_find);
data->AddWord(find, replace, useVariables);
@@ -352,7 +352,7 @@ static void ShowAddReplacement(HWND hwndDlg, int item = -1)
else
ListView_GetItemText(GetDlgItem(hwndDlg, IDC_REPLACEMENTS), item, 0, find, SIZEOF(find));
- if (lstrlen(find) > 0) {
+ if (mir_tstrlen(find) > 0) {
AutoReplacement &ar = data->autoReplaceMap[find];
replace = ar.replace.c_str();
useVariables = ar.useVariables;
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp
index d4b3fa7138..6b29b3335e 100644
--- a/plugins/SpellChecker/src/utils.cpp
+++ b/plugins/SpellChecker/src/utils.cpp
@@ -279,7 +279,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser,
int errors = 0;
TCHAR text[1024];
dlg->re->GetLine(line, text, SIZEOF(text));
- int len = lstrlen(text);
+ int len = mir_tstrlen(text);
int first_char = dlg->re->GetFirstCharOfLine(line);
// Now lets get the words
@@ -368,7 +368,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser,
if (dif != 0) {
// Read line again
dlg->re->GetLine(line, text, SIZEOF(text));
- len = lstrlen(text);
+ len = mir_tstrlen(text);
int old_first_char = first_char;
first_char = dlg->re->GetFirstCharOfLine(line);
@@ -689,7 +689,7 @@ int GetClosestLanguage(TCHAR *lang_name)
// Try searching by the prefix only
TCHAR lang[128];
- lstrcpyn(lang, lang_name, SIZEOF(lang));
+ mir_tstrncpy(lang, lang_name, SIZEOF(lang));
TCHAR *p = _tcschr(lang, _T('_'));
if (p != NULL)
@@ -701,7 +701,7 @@ int GetClosestLanguage(TCHAR *lang_name)
return i;
// Now try any suffix
- size_t len = lstrlen(lang);
+ size_t len = mir_tstrlen(lang);
for (i = 0; i < languages.getCount(); i++) {
TCHAR *p = _tcschr(languages[i]->language, _T('_'));
if (p == NULL)
@@ -747,7 +747,7 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch
if (lstrcmpi(dict->localized_name, lang) == 0
|| lstrcmpi(dict->english_name, lang) == 0
|| lstrcmpi(dict->language, lang) == 0) {
- lstrcpyn(dlg->lang_name, dict->language, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, dict->language, SIZEOF(dlg->lang_name));
break;
}
}
@@ -790,18 +790,18 @@ void GetContactLanguage(Dialog *dlg)
if (dlg->hContact == NULL) {
if (!db_get_ts(NULL, MODULE_NAME, dlg->name, &dbv)) {
- lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
db_free(&dbv);
}
}
else {
if (!db_get_ts(dlg->hContact, MODULE_NAME, "TalkLanguage", &dbv)) {
- lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == _T('\0') && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
- lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
db_free(&dbv);
}
@@ -810,12 +810,12 @@ void GetContactLanguage(Dialog *dlg)
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
- lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == _T('\0') && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
- lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name));
db_free(&dbv);
}
}
@@ -833,13 +833,13 @@ void GetContactLanguage(Dialog *dlg)
// Use default lang
if (dlg->lang_name[0] == _T('\0'))
- lstrcpyn(dlg->lang_name, opts.default_language, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, opts.default_language, SIZEOF(dlg->lang_name));
}
int i = GetClosestLanguage(dlg->lang_name);
if (i < 0) {
// Lost a dict?
- lstrcpyn(dlg->lang_name, opts.default_language, SIZEOF(dlg->lang_name));
+ mir_tstrncpy(dlg->lang_name, opts.default_language, SIZEOF(dlg->lang_name));
i = GetClosestLanguage(dlg->lang_name);
}
@@ -1040,7 +1040,7 @@ void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, TCHAR *name)
mii.fType = MFT_STRING;
mii.hSubMenu = hSubMenu;
mii.dwTypeData = name;
- mii.cch = lstrlen(name);
+ mii.cch = mir_tstrlen(name);
InsertMenuItem(hMenu, 0, TRUE, &mii);
}
@@ -1057,7 +1057,7 @@ void AppendMenuItem(HMENU hMenu, int id, TCHAR *name, HICON hIcon, BOOL checked)
mii.hbmpChecked = iconInfo.hbmColor;
mii.hbmpUnchecked = iconInfo.hbmColor;
mii.dwTypeData = name;
- mii.cch = lstrlen(name);
+ mii.cch = mir_tstrlen(name);
InsertMenuItem(hMenu, 0, TRUE, &mii);
}
@@ -1513,12 +1513,12 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
// Draw text
RECT rc_text = { 0, 0, 0xFFFF, 0xFFFF };
- DrawText(lpdis->hDC, dict->full_name, lstrlen(dict->full_name), &rc_text, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_TOP | DT_CALCRECT);
+ DrawText(lpdis->hDC, dict->full_name, mir_tstrlen(dict->full_name), &rc_text, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_TOP | DT_CALCRECT);
rc.right = lpdis->rcItem.right - 2;
rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - (rc_text.bottom - rc_text.top)) / 2;
rc.bottom = rc.top + rc_text.bottom - rc_text.top;
- DrawText(lpdis->hDC, dict->full_name, lstrlen(dict->full_name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_LEFT | DT_TOP | DT_SINGLELINE);
+ DrawText(lpdis->hDC, dict->full_name, mir_tstrlen(dict->full_name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_LEFT | DT_TOP | DT_SINGLELINE);
// Restore old colors
SetTextColor(lpdis->hDC, clrfore);
@@ -1546,7 +1546,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
RECT rc = { 0, 0, 0xFFFF, 0xFFFF };
- DrawText(hdc, dict->full_name, lstrlen(dict->full_name), &rc, DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_TOP | DT_CALCRECT);
+ DrawText(hdc, dict->full_name, mir_tstrlen(dict->full_name), &rc, DT_NOPREFIX | DT_SINGLELINE | DT_LEFT | DT_TOP | DT_CALCRECT);
lpmis->itemHeight = max(ICON_SIZE, max(bmpChecked.bmHeight, rc.bottom));
lpmis->itemWidth = 2 + bmpChecked.bmWidth + 2 + ICON_SIZE + 4 + rc.right + 2;
@@ -1563,7 +1563,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
TCHAR* lstrtrim(TCHAR *str)
{
- int len = lstrlen(str);
+ int len = mir_tstrlen(str);
int i;
for (i = len - 1; i >= 0 && (str[i] == ' ' || str[i] == '\t'); --i);
diff --git a/plugins/SplashScreen/src/bitmap_funcs.cpp b/plugins/SplashScreen/src/bitmap_funcs.cpp
index f6f2ce5f4b..d7c489669d 100644
--- a/plugins/SplashScreen/src/bitmap_funcs.cpp
+++ b/plugins/SplashScreen/src/bitmap_funcs.cpp
@@ -162,7 +162,7 @@ void MyBitmap::Blend(MyBitmap *bmp, int x, int y, int w, int h)
void MyBitmap::DrawText(TCHAR *str, int x, int y)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, lstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x+10000, y+10000);
this->saveAlpha(x-2,y-2,sz.cx+2,sz.cy+2);
::DrawText(this->getDC(), str, (int)_tcslen(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
@@ -208,7 +208,7 @@ bool MyBitmap::loadFromFile(TCHAR *fn, TCHAR *fnAlpha)
SIZE sz;
TCHAR *ext;
- ext = &fn[lstrlen(fn)-4];
+ ext = &fn[mir_tstrlen(fn)-4];
if (!lstrcmpi(ext, _T(".png")))
{
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp
index 1ebb02c105..fddf1bb56a 100644
--- a/plugins/SplashScreen/src/options.cpp
+++ b/plugins/SplashScreen/src/options.cpp
@@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
// Make path relative
int result = PathToRelativeT(szTempPath, szPath2Spash);
- if(result && lstrlen(szPath2Spash) > 0)
+ if(result && mir_tstrlen(szPath2Spash) > 0)
{
if (options.random)
{
@@ -278,7 +278,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
// Make path relative
int result = PathToRelativeT(szTempPath, szSoundFilePath);
- if(result && lstrlen(szSoundFile) > 0)
+ if(result && mir_tstrlen(szSoundFile) > 0)
SetWindowText(GetDlgItem(hwndDlg, IDC_SNDPATH),szSoundFilePath);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp
index 74218f4ebf..7020509cad 100644
--- a/plugins/StatusPlugins/commonstatus.cpp
+++ b/plugins/StatusPlugins/commonstatus.cpp
@@ -54,7 +54,7 @@ char *StatusModeToDbSetting(int status,const char *suffix)
case ID_STATUS_OUTTOLUNCH: prefix="Otl"; break;
default: return NULL;
}
- lstrcpyA(str,prefix); lstrcatA(str,suffix);
+ mir_strcpy(str,prefix); mir_strcat(str,suffix);
return str;
}
@@ -183,10 +183,10 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus)
else
continue;
- if (lstrlen(substituteStr) > 6)
- tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(lstrlen(tszMsg) + 1 + lstrlen(substituteStr) - 6));
- MoveMemory(tszMsg + j + lstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(lstrlen(tszMsg) - j - 5));
- CopyMemory(tszMsg + j, substituteStr, sizeof(TCHAR)*lstrlen(substituteStr));
+ if (mir_tstrlen(substituteStr) > 6)
+ tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
+ MoveMemory(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5));
+ CopyMemory(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr));
}
TCHAR *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index a2e3a22b6b..5897463b61 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -129,8 +129,8 @@ const int Stricmp(const TCHAR *str, const TCHAR *substr)
TCHAR *str_up = NEWTSTR_MALLOC(str);
TCHAR *substr_up = NEWTSTR_MALLOC(substr);
- CharUpperBuff(str_up, lstrlen(str_up));
- CharUpperBuff(substr_up, lstrlen(substr_up));
+ CharUpperBuff(str_up, mir_tstrlen(str_up));
+ CharUpperBuff(substr_up, mir_tstrlen(substr_up));
i = _tcscmp(str_up, substr_up);
@@ -189,7 +189,7 @@ BOOL IsUrlContains(TCHAR * Str)
if(Str && _tcslen(Str)>0) {
TCHAR *StrLower = NEWTSTR_MALLOC(Str);
- CharLowerBuff(StrLower, lstrlen(StrLower));
+ CharLowerBuff(StrLower, mir_tstrlen(StrLower));
for (int i=0; i<CountUrl; i++)
if(_tcsstr (StrLower, URL[i]))
{
@@ -247,7 +247,7 @@ void LogSpamToFile(MCONTACT hContact, tstring message)
if (hStopSpamLogDirH)
FoldersGetCustomPathT(hStopSpamLogDirH, pszName, MAX_PATH, _T(""));
else
- lstrcpyn(pszName, VARST( _T("%miranda_logpath%")), SIZEOF(pszName));
+ mir_tstrncpy(pszName, VARST( _T("%miranda_logpath%")), SIZEOF(pszName));
filename = pszName;
filename = filename + _T("\\stopspam_mod.log");
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp
index 58fe1c4301..5538eb690f 100644
--- a/plugins/TabSRMM/src/TSButton.cpp
+++ b/plugins/TabSRMM/src/TSButton.cpp
@@ -292,7 +292,7 @@ nonflat_themed:
}
SIZE sz;
- GetTextExtentPoint32(hdcMem, szText, lstrlen(szText), &sz);
+ GetTextExtentPoint32(hdcMem, szText, mir_tstrlen(szText), &sz);
if (ctl->cHot) {
SIZE szHot;
GetTextExtentPoint32A(hdcMem, "&", 1, &szHot);
@@ -301,7 +301,7 @@ nonflat_themed:
if (ctl->arrow)
DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - PluginConfig.m_smcxicon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - PluginConfig.m_smcyicon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, lstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_tstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index 37987d4278..cdc0a8af53 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -144,7 +144,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **
}
if ( szTemp[0] ) {
- size_t iLen = lstrlen(szTemp);
+ size_t iLen = mir_tstrlen(szTemp);
memcpy( d, szTemp, iLen * sizeof(TCHAR));
d += iLen;
}
@@ -432,9 +432,9 @@ static TCHAR * _tcsrplc(TCHAR **src, const TCHAR *ptrn, const TCHAR *rplc)
size_t lSrc, lPtrn, lRplc;
TCHAR *tszFound, *tszTail;
- lSrc = lstrlen(*src);
- lPtrn = lstrlen(ptrn);
- lRplc = lstrlen(rplc);
+ lSrc = mir_tstrlen(*src);
+ lPtrn = mir_tstrlen(ptrn);
+ lRplc = mir_tstrlen(rplc);
if (lPtrn && lSrc && lSrc >= lPtrn && (tszFound = _tcsstr(*src, ptrn)) != NULL) {
if (lRplc > lPtrn)
*src = (TCHAR*) mir_realloc((void*) * src,
@@ -463,9 +463,9 @@ static TCHAR * _tcsnrplc(TCHAR *src, size_t n, const TCHAR *ptrn, const TCHAR *r
size_t lSrc, lPtrn, lRplc;
TCHAR *tszFound, *tszTail;
- lSrc = lstrlen(src);
- lPtrn = lstrlen(ptrn);
- lRplc = lstrlen(rplc);
+ lSrc = mir_tstrlen(src);
+ lPtrn = mir_tstrlen(ptrn);
+ lRplc = mir_tstrlen(rplc);
if (lPtrn && lSrc && lSrc >= lPtrn && /* lengths are ok */
(tszFound = _tcsstr(src, ptrn)) != NULL && /* pattern was found in string */
(n < 0 || lSrc - lPtrn + lRplc < n) && /* there is enough room in the string */
@@ -591,7 +591,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
}
if (szTemp[0]) {
- int iLen = lstrlenA(szTemp);
+ int iLen = mir_strlen(szTemp);
memcpy(d, szTemp, iLen);
d += iLen;
}
@@ -623,11 +623,11 @@ static void AddEventToBuffer(char **buffer, int *bufferEnd, int *bufferAlloced,
return;
if (streamData->lin->ptszNick) {
- if (g_Settings.bLogLimitNames && lstrlen(streamData->lin->ptszNick) > 20) {
- lstrcpyn(szTemp, streamData->lin->ptszNick, 20);
- lstrcpyn(szTemp + 20, _T("..."), 4);
+ if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
+ mir_tstrncpy(szTemp, streamData->lin->ptszNick, 20);
+ mir_tstrncpy(szTemp + 20, _T("..."), 4);
}
- else lstrcpyn(szTemp, streamData->lin->ptszNick, 511);
+ else mir_tstrncpy(szTemp, streamData->lin->ptszNick, 511);
if (g_Settings.bClickableNicks)
mir_sntprintf(szTemp2, SIZEOF(szTemp2), _T("~~++#%s#++~~"), szTemp);
@@ -883,8 +883,8 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
if (g_Settings.bShowTime) {
TCHAR szTimeStamp[30], szOldTimeStamp[30];
- lstrcpyn(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), 30);
- lstrcpyn(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), 30);
+ mir_tstrncpy(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), 30);
+ mir_tstrncpy(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), 30);
if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || lstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, &buffer, &bufferEnd, &bufferAlloced, _T("%s"), szTimeStamp);
@@ -906,7 +906,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
if (g_Settings.bLogClassicIndicators)
Log_Append(&buffer, &bufferEnd, &bufferAlloced, "%s", pszIndicator);
- lstrcpyn(pszTemp, lin->bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick, 299);
+ mir_tstrncpy(pszTemp, lin->bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick, 299);
p1 = _tcsstr(pszTemp, _T("%n"));
if (p1)
p1[1] = 's';
@@ -950,7 +950,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
if (lstrdat->buffer == NULL) {
lstrdat->bufferOffset = 0;
lstrdat->buffer = Log_CreateRTF(lstrdat);
- lstrdat->bufferLen = lstrlenA(lstrdat->buffer);
+ lstrdat->bufferLen = mir_strlen(lstrdat->buffer);
}
// give the RTF to the RE control
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp
index 605341583d..4c45d5bb11 100644
--- a/plugins/TabSRMM/src/chat/message.cpp
+++ b/plugins/TabSRMM/src/chat/message.cpp
@@ -107,7 +107,7 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si)
}
else p1 += 7;
- MoveMemory(pszText, p1, lstrlenA(p1) + 1);
+ MoveMemory(pszText, p1, mir_strlen(p1) + 1);
p1 = pszText;
// iterate through all characters, if rtf control character found then take action
@@ -295,9 +295,9 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si)
// move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
- MoveMemory(p1 + lstrlenA(InsertThis) , p1 + iRemoveChars, lstrlenA(p1) - iRemoveChars + 1);
- CopyMemory(p1, InsertThis, lstrlenA(InsertThis));
- p1 += lstrlenA(InsertThis);
+ MoveMemory(p1 + mir_strlen(InsertThis) , p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1);
+ CopyMemory(p1, InsertThis, mir_strlen(InsertThis));
+ p1 += mir_strlen(InsertThis);
}
else p1++;
}
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 12567262b6..1103d33dd8 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -224,14 +224,14 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
mir_snprintf(str, SIZEOF(str), "Font%d", i);
if ((i == 17 && !strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
- lstrcpyn(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
}
else {
ptrT tszDefFace(db_get_tsa(NULL, szMod, str));
if (tszDefFace == NULL)
- lstrcpy(lf->lfFaceName, fol[j].szDefFace);
+ mir_tstrcpy(lf->lfFaceName, fol[j].szDefFace);
else
- lstrcpyn(lf->lfFaceName, tszDefFace, SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, tszDefFace, SIZEOF(lf->lfFaceName));
}
}
}
@@ -885,11 +885,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (idList) {
const TCHAR *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
- lstrcat(tszDirectory, _T("\\"));
+ mir_tstrcat(tszDirectory, _T("\\"));
TCHAR tszTemp[MAX_PATH];
PathToRelativeT(tszDirectory, tszTemp, szUserDir);
- SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index 722d902956..6e76d1a302 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -58,15 +58,15 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
// cut nickname if larger than x chars...
TCHAR newcontactname[128];
- if (lstrlen(contactName) > 0) {
+ if (mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, SIZEOF(newcontactname));
else {
- lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname));
+ mir_tstrncpy(newcontactname, contactName, SIZEOF(newcontactname));
newcontactname[127] = 0;
}
}
- else lstrcpyn(newcontactname, _T("_U_"), SIZEOF(newcontactname));
+ else mir_tstrncpy(newcontactname, _T("_U_"), SIZEOF(newcontactname));
newData.item.pszText = newcontactname;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 2c803e4b98..dcbb4947e2 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -103,7 +103,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
va_list marker;
static TCHAR szBuf[4 * 1024];
- if (!fmt || lstrlen(fmt) == 0 || lstrlen(fmt) > 2000)
+ if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000)
return 0;
va_start(marker, fmt);
@@ -122,7 +122,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
(pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
pcli->pfnGetContactDisplayName(hContact, 0));
- lstrcpyn(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE);
+ mir_tstrncpy(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE);
pd.iSeconds = g_Settings.iPopupTimeout;
if (g_Settings.iPopupStyle == 2) {
@@ -554,10 +554,10 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
if (pszWordText)
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
else
- lstrcpyn(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
+ mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
- if (lstrlen(szTemp) > 40)
- lstrcpyn(szTemp + 40, _T("..."), 4);
+ if (mir_tstrlen(szTemp) > 40)
+ mir_tstrncpy(szTemp + 40, _T("..."), 4);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 23489fd0c9..1fb1a58d68 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -208,7 +208,7 @@ bool IsStringValidLink(TCHAR* pszText)
{
if (pszText == NULL)
return false;
- if (lstrlen(pszText) < 5 || _tcschr(pszText, '"'))
+ if (mir_tstrlen(pszText) < 5 || _tcschr(pszText, '"'))
return false;
if (_totlower(pszText[0]) == 'w' && _totlower(pszText[1]) == 'w' && _totlower(pszText[2]) == 'w' && pszText[3] == '.' && _istalnum(pszText[4]))
@@ -1535,11 +1535,11 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
}
if (wParam == '\b' && si->szSearch[0]) // backspace
- si->szSearch[lstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
else if (wParam < ' ')
break;
else {
- if (lstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) {
+ if (mir_tstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) {
MessageBeep(MB_OK);
break;
}
@@ -1557,7 +1557,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
for (i=0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!_tcsnicmp(ui->pszNick, si->szSearch, lstrlen(si->szSearch))) {
+ if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETSEL, FALSE, -1);
SendMessage(hwnd, LB_SETSEL, TRUE, i);
si->iSearchItem = i;
@@ -1568,7 +1568,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
if (i == iItems) {
MessageBeep(MB_OK);
- si->szSearch[lstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
return 0;
}
}
@@ -1994,11 +1994,11 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->wStatus = si->wStatus;
const TCHAR *szNick = dat->cache->getNick();
- if (lstrlen(szNick) > 0) {
+ if (mir_tstrlen(szNick) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(szNick, dat->newtitle, SIZEOF(dat->newtitle));
else {
- lstrcpyn(dat->newtitle, szNick, SIZEOF(dat->newtitle));
+ mir_tstrncpy(dat->newtitle, szNick, SIZEOF(dat->newtitle));
dat->newtitle[129] = 0;
}
}
@@ -2096,7 +2096,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (si->ptszStatusbarText)
mir_sntprintf(szFinalStatusBarText, SIZEOF(szFinalStatusBarText), _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText);
else {
- lstrcpyn(szFinalStatusBarText, mi->ptszModDispName, SIZEOF(szFinalStatusBarText));
+ mir_tstrncpy(szFinalStatusBarText, mi->ptszModDispName, SIZEOF(szFinalStatusBarText));
szFinalStatusBarText[511] = 0;
}
}
@@ -2332,16 +2332,16 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SIZE sz;
if (si->iSearchItem != -1 && si->iSearchItem == index && si->szSearch[0]) {
COLORREF clr_orig = GetTextColor(dis->hDC);
- GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(si->szSearch), &sz);
+ GetTextExtentPoint32(dis->hDC, ui->pszNick, mir_tstrlen(si->szSearch), &sz);
SetTextColor(dis->hDC, RGB(250, 250, 0));
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(si->szSearch));
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, mir_tstrlen(si->szSearch));
SetTextColor(dis->hDC, clr_orig);
x_offset += sz.cx;
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + lstrlen(si->szSearch), lstrlen(ui->pszNick) - lstrlen(si->szSearch));
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_tstrlen(si->szSearch), mir_tstrlen(ui->pszNick) - mir_tstrlen(si->szSearch));
}
else {
- GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(ui->pszNick), &sz);
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(ui->pszNick));
+ GetTextExtentPoint32(dis->hDC, ui->pszNick, mir_tstrlen(ui->pszNick), &sz);
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, mir_tstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
}
return TRUE;
@@ -2665,7 +2665,7 @@ LABEL_SHOWWINDOW:
int iRes = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0) {
- int iLen = lstrlen(pszWord) - 1;
+ int iLen = mir_tstrlen(pszWord) - 1;
while (iLen >= 0 && strchr(szTrimString, pszWord[iLen])) {
pszWord[iLen] = '\0';
iLen--;
@@ -2785,8 +2785,8 @@ LABEL_SHOWWINDOW:
break;
EmptyClipboard();
{
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR) * (lstrlen(tr.lpstrText) + 1));
- lstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR) * (mir_tstrlen(tr.lpstrText) + 1));
+ mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
}
@@ -2842,7 +2842,7 @@ LABEL_SHOWWINDOW:
else if (msg == WM_LBUTTONUP) {
USERINFO *ui = si->pUsers;
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr);
- size_t bufSize = lstrlen(tr.lpstrText) + lstrlen(tszAplTmpl) + 3;
+ size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3;
tszTmp = tszAppeal = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR));
tr2.lpstrText = (LPTSTR) mir_alloc(sizeof(TCHAR) * 2);
if (chr.cpMin) {
@@ -2857,7 +2857,7 @@ LABEL_SHOWWINDOW:
else
/* in the beginning of the message window */
mir_sntprintf(tszAppeal, bufSize, tszAplTmpl, tr.lpstrText);
- st = lstrlen(tszAppeal);
+ st = mir_tstrlen(tszAppeal);
if (chr.cpMax != -1) {
tr2.chrg.cpMin = chr.cpMax;
tr2.chrg.cpMax = chr.cpMax + 1;
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 22a445fe3d..df70c33104 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -467,7 +467,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
m_szStatusMsg = 0;
ptrT szStatus(db_get_tsa(hContact, "CList", "StatusMsg"));
if (szStatus != 0)
- m_szStatusMsg = (lstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0);
+ m_szStatusMsg = (mir_tstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0);
}
if (szKey == 0 || (szKey && !strcmp("ListeningTo", szKey))) {
if (m_ListeningInfo)
@@ -545,7 +545,7 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll)
size_t k = 0, i = 0;
TCHAR* tszResult = 0;
- if (src == 0 || lstrlen(src) < 2)
+ if (src == 0 || mir_tstrlen(src) < 2)
return 0;
tstring dest;
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 929308b88d..727a1d09ca 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -1865,7 +1865,7 @@ panel_found:
char szCName[40];
mir_snprintf(szCName, 40, "%s_theme", CONTAINER_PREFIX);
- if (lstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
@@ -1990,8 +1990,8 @@ int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size
{
int cutMax = PluginConfig.m_CutContactNameTo;
- if (lstrlen(oldname) <= cutMax) {
- lstrcpyn(newname, oldname, size);
+ if (mir_tstrlen(oldname) <= cutMax) {
+ mir_tstrncpy(newname, oldname, size);
newname[size - 1] = 0;
}
else {
@@ -2023,7 +2023,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer)
TContainerData* TSAPI FindContainerByName(const TCHAR *name)
{
- if (name == NULL || lstrlen(name) == 0)
+ if (name == NULL || mir_tstrlen(name) == 0)
return 0;
if (M.GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container
@@ -2188,7 +2188,7 @@ void TSAPI DeleteContainer(int iIndex)
void TSAPI RenameContainer(int iIndex, const TCHAR *szNew)
{
- if (lstrlen(szNew) == 0)
+ if (mir_tstrlen(szNew) == 0)
return;
char szIndex[10];
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index 7af5e2671e..173308a77f 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -491,7 +491,7 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe)
iPreviewLimit = 500;
TCHAR* buf = DbGetEventTextT(dbe, CP_ACP);
- if (lstrlen(buf) > iPreviewLimit) {
+ if (mir_tstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
int iIndex = iPreviewLimit;
int iWordThreshold = 20;
@@ -501,7 +501,7 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe)
buf[iIndex] = 0;
}
if (fAddEllipsis) {
- buf = (TCHAR*)mir_realloc(buf, (lstrlen(buf) + 5) * sizeof(TCHAR));
+ buf = (TCHAR*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(TCHAR));
_tcscat(buf, _T("..."));
}
return buf;
@@ -602,12 +602,12 @@ static int PopupUpdateT(MCONTACT hContact, HANDLE hEvent)
int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
_tcsncpy(lpzText, szHeader, MAX_SECONDLINE);
- available -= lstrlen(szHeader);
+ available -= mir_tstrlen(szHeader);
}
else lpzText[0] = 0;
for (i = pdata->nrMerged; i >= 0; i--) {
- available -= lstrlen(pdata->eventData[i].tszText);
+ available -= mir_tstrlen(pdata->eventData[i].tszText);
if (available <= 0)
break;
}
@@ -748,7 +748,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced)
mii.dwItemData = 0;
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = lstrlen(szMenuEntry) + 1;
+ mii.cch = mir_tstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii);
@@ -814,7 +814,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
- mii.cch = lstrlen(szMenuEntry) + 1;
+ mii.cch = mir_tstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index a36fb66943..3f95a9d939 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -1064,8 +1064,8 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
else if (dat->lastMessage) {
TCHAR date[64], time[64];
tmi.printTimeStamp(NULL, dat->lastMessage, _T("d"), date, SIZEOF(date), 0);
- if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && lstrlen(date) > 6)
- date[lstrlen(date) - 5] = 0;
+ if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6)
+ date[mir_tstrlen(date) - 5] = 0;
tmi.printTimeStamp(NULL, dat->lastMessage, _T("t"), time, SIZEOF(time), 0);
mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("Last received: %s at %s"), date, time);
}
@@ -1109,16 +1109,16 @@ LRESULT TSAPI DM_WMCopyHandler(HWND hwnd, WNDPROC oldWndProc, UINT msg, WPARAM w
HANDLE hClip = GetClipboardData(CF_UNICODETEXT);
if (!hClip)
goto err_out;
- TCHAR *tszText = (TCHAR*)mir_alloc((lstrlen((TCHAR*)hClip) + 2) * sizeof(TCHAR));
+ TCHAR *tszText = (TCHAR*)mir_alloc((mir_tstrlen((TCHAR*)hClip) + 2) * sizeof(TCHAR));
if (!tszText)
goto err_out;
- lstrcpy(tszText, (TCHAR*)hClip);
+ mir_tstrcpy(tszText, (TCHAR*)hClip);
Utils::FilterEventMarkers(tszText);
EmptyClipboard();
- HGLOBAL hgbl = GlobalAlloc(GMEM_MOVEABLE, (lstrlen(tszText) + 1) * sizeof(TCHAR));
+ HGLOBAL hgbl = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tszText) + 1) * sizeof(TCHAR));
TCHAR *tszLocked = (TCHAR*)GlobalLock(hgbl);
- lstrcpy(tszLocked, tszText);
+ mir_tstrcpy(tszLocked, tszText);
GlobalUnlock(hgbl);
SetClipboardData(CF_UNICODETEXT, hgbl);
mir_free(tszText);
@@ -1763,11 +1763,11 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam)
if (PluginConfig.m_CutContactNameOnTabs)
CutContactName(szNick, newcontactname, SIZEOF(newcontactname));
else
- lstrcpyn(newcontactname, szNick, SIZEOF(newcontactname));
+ mir_tstrncpy(newcontactname, szNick, SIZEOF(newcontactname));
Utils::DoubleAmpersands(newcontactname);
- if (lstrlen(newcontactname) != 0 && dat->szStatus != NULL) {
+ if (mir_tstrlen(newcontactname) != 0 && dat->szStatus != NULL) {
if (PluginConfig.m_StatusOnTabs)
mir_sntprintf(newtitle, 127, _T("%s (%s)"), newcontactname, dat->szStatus);
else
@@ -1792,7 +1792,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam)
SendMessage(GetDlgItem(hwndDlg, IDC_NAME), BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR);
}
}
- else lstrcpyn(newtitle, _T("Message Session"), SIZEOF(newtitle));
+ else mir_tstrncpy(newtitle, _T("Message Session"), SIZEOF(newtitle));
if (dat->idle != dwOldIdle || lParam != 0) {
if (item.mask & TCIF_TEXT) {
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 2be3094c7a..03d1ff2daf 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -429,7 +429,7 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam)
fChanged = c->updateStatus();
fNickChanged = c->updateNick();
}
- if (lstrlenA(setting) > 6 && lstrlenA(setting) < 9 && !strncmp(setting, "Status", 6)) {
+ if (mir_strlen(setting) > 6 && mir_strlen(setting) < 9 && !strncmp(setting, "Status", 6)) {
fChanged = true;
if (c) {
c->updateMeta();
@@ -443,7 +443,7 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam)
c->updateUIN();
PostMessage(hwnd, DM_UPDATEUIN, 0, 0);
}
- else if (lstrlenA(setting) > 6 && strstr("StatusMsg,XStatusMsg,XStatusName,XStatusId,ListeningTo", setting)) {
+ else if (mir_strlen(setting) > 6 && strstr("StatusMsg,XStatusMsg,XStatusName,XStatusId,ListeningTo", setting)) {
if (c) {
c->updateStatusMsg(setting);
fExtendedStatusChange = true;
@@ -624,7 +624,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
ptrA szMsg(mir_utf8encodeT(text));
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.pBlob = (PBYTE)(char*)szMsg;
- dbei.cbBlob = lstrlenA(szMsg) + 1;
+ dbei.cbBlob = mir_strlen(szMsg) + 1;
dbei.flags = DBEF_UTF | DBEF_READ;
dbei.eventType = EVENTTYPE_STATUSCHANGE;
dbei.timestamp = time(NULL);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 30fafd3cd5..19bce88c6e 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -431,9 +431,9 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem)
if (szStatusMsg) {
SIZE sStatusMsg, sMask;
- ::GetTextExtentPoint32(hdc, szTextToShow, lstrlen(szTextToShow), &m_szNick);
+ ::GetTextExtentPoint32(hdc, szTextToShow, mir_tstrlen(szTextToShow), &m_szNick);
::GetTextExtentPoint32(hdc, _T("A"), 1, &sMask);
- ::GetTextExtentPoint32(hdc, szStatusMsg, lstrlen(szStatusMsg), &sStatusMsg);
+ ::GetTextExtentPoint32(hdc, szStatusMsg, mir_tstrlen(szStatusMsg), &sStatusMsg);
DWORD dtFlagsNick = DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_NOPREFIX;
if ((m_szNick.cx + sStatusMsg.cx + 6) < (rcItem.right - rcItem.left) || (rcItem.bottom - rcItem.top) < (2 * sMask.cy)) {
@@ -466,7 +466,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem)
CSkin::RenderText(hdc, m_dat->hThemeIP, szStatusMsg, &rcItem, dtFlags, CSkin::m_glowSize, clr);
}
else {
- GetTextExtentPoint32(hdc, szTextToShow, lstrlen(szTextToShow), &m_szNick);
+ GetTextExtentPoint32(hdc, szTextToShow, mir_tstrlen(szTextToShow), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, fShowUin ? m_ipConfig.hFonts[IPFONTID_UIN] : m_ipConfig.hFonts[IPFONTID_NICK]);
@@ -522,7 +522,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
}
SIZE sUIN;
- ::GetTextExtentPoint32(hdc, szBuf, lstrlen(szBuf), &sUIN);
+ ::GetTextExtentPoint32(hdc, szBuf, mir_tstrlen(szBuf), &sUIN);
mapRealRect(rcItem, m_rcUIN, sUIN);
CSkin::RenderText(hdc, m_dat->hThemeIP, szBuf, &rcItem, DT_SINGLELINE | DT_VCENTER, CSkin::m_glowSize, clr);
}
@@ -545,7 +545,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
DWORD oldPanelStatusCX = m_dat->panelStatusCX;
if (m_dat->szStatus[0])
- GetTextExtentPoint32(hdc, m_dat->szStatus, lstrlen(m_dat->szStatus), &sStatus);
+ GetTextExtentPoint32(hdc, m_dat->szStatus, mir_tstrlen(m_dat->szStatus), &sStatus);
/*
* figure out final account name
@@ -553,13 +553,13 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
const TCHAR *szFinalProto = m_dat->cache->getRealAccount();
if (szFinalProto) {
SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]);
- GetTextExtentPoint32(hdc, szFinalProto, lstrlen(szFinalProto), &sProto);
+ GetTextExtentPoint32(hdc, szFinalProto, mir_tstrlen(szFinalProto), &sProto);
}
TCHAR szResult[80]; szResult[0] = 0;
if (m_dat->hTimeZone) {
tmi.printDateTime(m_dat->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0);
- GetTextExtentPoint32(hdc, szResult, lstrlen(szResult), &sTime);
+ GetTextExtentPoint32(hdc, szResult, mir_tstrlen(szResult), &sTime);
}
m_dat->panelStatusCX = 3 + sStatus.cx + sProto.cx + 14 + (m_dat->hClientIcon ? 20 : 0) + sTime.cx + 13;
@@ -641,7 +641,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
const TCHAR *tszNick = m_dat->cache->getNick();
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(hdc, tszNick, lstrlen(tszNick), &m_szNick);
+ ::GetTextExtentPoint32(hdc, tszNick, mir_tstrlen(tszNick), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
@@ -689,7 +689,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
SIZE szTitle;
TCHAR szPrefix[100];
mir_sntprintf(szPrefix, 100, TranslateT("Topic is: %s"), _T(""));
- ::GetTextExtentPoint32(hdc, szPrefix, lstrlen(szPrefix), &szTitle);
+ ::GetTextExtentPoint32(hdc, szPrefix, mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_UIN]);
@@ -698,7 +698,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
rcItem.left += (szTitle.cx + 4);
if (m_hoverFlags & HOVER_UIN)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- if (si->ptszTopic && lstrlen(si->ptszTopic) > 1)
+ if (si->ptszTopic && mir_tstrlen(si->ptszTopic) > 1)
CSkin::RenderText(hdc, m_dat->hThemeIP, si->ptszTopic, &rcItem, DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX | DT_TOP, CSkin::m_glowSize, clr);
else
CSkin::RenderText(hdc, m_dat->hThemeIP, TranslateT("no topic set."), &rcItem, DT_TOP| DT_SINGLELINE | DT_NOPREFIX, CSkin::m_glowSize, clr);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index bdf6efb0a5..f0ff2f09d4 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -133,9 +133,9 @@ const TCHAR* CMimAPI::getUserDir()
{
if (m_userDir[0] == 0) {
if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
- lstrcpyn(m_userDir, L"%miranda_userdata%", SIZEOF(m_userDir));
+ mir_tstrncpy(m_userDir, L"%miranda_userdata%", SIZEOF(m_userDir));
else
- lstrcpyn(m_userDir, VARST(_T("%miranda_userdata%")), SIZEOF(m_userDir));
+ mir_tstrncpy(m_userDir, VARST(_T("%miranda_userdata%")), SIZEOF(m_userDir));
Utils::ensureTralingBackslash(m_userDir);
}
@@ -152,12 +152,12 @@ void CMimAPI::InitPaths()
mir_sntprintf(m_szProfilePath, MAX_PATH, _T("%stabSRMM"), szUserdataDir);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
- lstrcpyn(m_szChatLogsPath, _T("%miranda_logpath%"), MAX_PATH);
- lstrcpyn(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), MAX_PATH);
+ mir_tstrncpy(m_szChatLogsPath, _T("%miranda_logpath%"), MAX_PATH);
+ mir_tstrncpy(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), MAX_PATH);
}
else {
- lstrcpyn(m_szChatLogsPath, VARST(_T("%miranda_logpath%")), MAX_PATH);
- lstrcpyn(m_szSkinsPath, VARST(_T("%miranda_path%\\Skins\\TabSRMM")), MAX_PATH);
+ mir_tstrncpy(m_szChatLogsPath, VARST(_T("%miranda_logpath%")), MAX_PATH);
+ mir_tstrncpy(m_szSkinsPath, VARST(_T("%miranda_path%\\Skins\\TabSRMM")), MAX_PATH);
}
Utils::ensureTralingBackslash(m_szChatLogsPath);
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index 5b6e109612..1e91712136 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -122,7 +122,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
if (res == 0)
break;
- bufSize = textlenght + lstrlen(pszMenu[res - 1]) + 2;
+ bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2;
pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR));
mir_sntprintf(pszFormatedText, bufSize, pszMenu[res-1], pszText);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 9b334fb22f..1735b763a8 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -624,7 +624,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
if (OpenClipboard(hwnd)) {
HANDLE hClip = GetClipboardData(CF_TEXT);
if (hClip) {
- if (lstrlenA((char*)hClip) > mwdat->nMax) {
+ if (mir_strlen((char*)hClip) > mwdat->nMax) {
TCHAR szBuffer[512];
if (M.GetByte("autosplit", 0))
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
@@ -2112,9 +2112,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
break;
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1));
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
TCHAR *buf = (TCHAR*)GlobalLock(hData);
- lstrcpy(buf, tr.lpstrText);
+ mir_tstrcpy(buf, tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -2751,7 +2751,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
int memRequired = 0, flags = 0;
if (!IsUtfSendAvailable(dat->hContact)) {
flags |= PREF_UNICODE;
- memRequired = bufSize + ((lstrlenW(decoded) + 1) * sizeof(WCHAR));
+ memRequired = bufSize + ((mir_wstrlen(decoded) + 1) * sizeof(WCHAR));
}
else {
flags |= PREF_UTF;
@@ -2788,7 +2788,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
else {
WideCharToMultiByte(dat->codePage, 0, decoded, -1, dat->sendBuffer, bufSize, 0, 0);
if (flags & PREF_UNICODE)
- CopyMemory(&dat->sendBuffer[bufSize], decoded, (lstrlenW(decoded) + 1) * sizeof(WCHAR));
+ CopyMemory(&dat->sendBuffer[bufSize], decoded, (mir_wstrlen(decoded) + 1) * sizeof(WCHAR));
}
if (memRequired == 0 || dat->sendBuffer[0] == 0)
@@ -2896,13 +2896,13 @@ quote_from_last:
}
}
if (dbei.eventType == EVENTTYPE_FILE) {
- int iDescr = lstrlenA((char *)(szText + sizeof(DWORD)));
+ int iDescr = mir_strlen((char *)(szText + sizeof(DWORD)));
MoveMemory(szText, szText + sizeof(DWORD), iDescr);
MoveMemory(szText + iDescr + 2, szText + sizeof(DWORD)+iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1);
szText[iDescr] = '\r';
szText[iDescr + 1] = '\n';
- szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + lstrlenA((char *)szText)));
- MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + lstrlenA((char *)szText));
+ szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + mir_strlen((char *)szText)));
+ MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + mir_strlen((char *)szText));
iAlloced = true;
}
ptrT szQuoted(QuoteText(szConverted, iCharsPerLine, 0));
@@ -3078,7 +3078,7 @@ quote_from_last:
case DM_MYAVATARCHANGED:
{
const char *szProto = dat->cache->getActiveProto();
- if (!strcmp((char *)wParam, szProto) && lstrlenA(szProto) == lstrlenA((char *)wParam))
+ if (!strcmp((char *)wParam, szProto) && mir_strlen(szProto) == mir_strlen((char *)wParam))
LoadOwnAvatar(dat);
}
break;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 85bad73929..07bc06b0b0 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -291,7 +291,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
szText = TranslateT("Set Your Avatar...");
}
mii.dwTypeData = szText;
- mii.cch = lstrlen(szText) + 1;
+ mii.cch = mir_tstrlen(szText) + 1;
SetMenuItemInfo(submenu, ID_PICMENU_SETTINGS, FALSE, &mii);
}
else if (menuID == MENU_PANELPICMENU) {
@@ -453,13 +453,13 @@ void TSAPI UpdateReadChars(const TWindowData *dat)
TCHAR szBuf[20]; szBuf[0] = 0;
if (dat->fInsertMode)
- lstrcat(szBuf, _T("O"));
+ mir_tstrcat(szBuf, _T("O"));
if (fCaps)
- lstrcat(szBuf, _T("C"));
+ mir_tstrcat(szBuf, _T("C"));
if (fNum)
- lstrcat(szBuf, _T("N"));
+ mir_tstrcat(szBuf, _T("N"));
if (dat->fInsertMode || fCaps || fNum)
- lstrcat(szBuf, _T(" | "));
+ mir_tstrcat(szBuf, _T(" | "));
mir_sntprintf(buf, SIZEOF(buf), _T("%s%s %d/%d"), szBuf, dat->lcID, dat->iOpenJobs, len);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM)buf);
@@ -663,7 +663,7 @@ TCHAR* TSAPI QuoteText(const TCHAR *text, int charsPerLine, int removeExistingQu
int justDoneLineBreak, bufSize;
TCHAR *strout;
- bufSize = lstrlenW(text) + 23;
+ bufSize = mir_wstrlen(text) + 23;
strout = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR));
inChar = 0;
justDoneLineBreak = 1;
@@ -887,7 +887,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat)
TCHAR InsertThis[50];
p1 += 5;
- MoveMemory(pszText, p1, (lstrlen(p1) + 1) * sizeof(TCHAR));
+ MoveMemory(pszText, p1, (mir_tstrlen(p1) + 1) * sizeof(TCHAR));
p1 = pszText;
// iterate through all characters, if rtf control character found then take action
while (*p1 != '\0') {
@@ -903,7 +903,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat)
bJustRemovedRTF = TRUE;
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), iCol);
- iRemoveChars = 3 + lstrlen(szTemp);
+ iRemoveChars = 3 + mir_tstrlen(szTemp);
if (bTextHasStarted || iCol)
mir_sntprintf(InsertThis, SIZEOF(InsertThis), (iInd > 0) ? (inColor ? _T("[/color][color=%s]") : _T("[color=%s]")) : (inColor ? _T("[/color]") : _T("")), Utils::rtf_ctable[iInd - 1].szName);
inColor = iInd > 0 ? 1 : 0;
@@ -914,7 +914,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat)
bJustRemovedRTF = TRUE;
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), iCol);
- iRemoveChars = 10 + lstrlen(szTemp);
+ iRemoveChars = 10 + mir_tstrlen(szTemp);
}
else if (!_tcsncmp(p1, _T("\\par"), 4)) { // newline
bTextHasStarted = TRUE;
@@ -1079,7 +1079,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat)
// move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
size_t cbLen = _tcslen(InsertThis);
- MoveMemory(p1 + cbLen, p1 + iRemoveChars, (lstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR));
+ MoveMemory(p1 + cbLen, p1 + iRemoveChars, (mir_tstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR));
CopyMemory(p1, InsertThis, cbLen * sizeof(TCHAR));
p1 += cbLen;
}
@@ -1709,7 +1709,7 @@ void TSAPI LoadOverrideTheme(TContainerData *pContainer)
BOOL bReadTemplates = TRUE;
ZeroMemory(&pContainer->theme, sizeof(TLogTheme));
- if (lstrlen(pContainer->szAbsThemeFile) > 1) {
+ if (mir_tstrlen(pContainer->szAbsThemeFile) > 1) {
if (PathFileExists(pContainer->szAbsThemeFile)) {
if (CheckThemeVersion(pContainer->szAbsThemeFile) == 0) {
LoadThemeDefaults(pContainer);
@@ -1828,7 +1828,7 @@ void TSAPI GetMyNick(TWindowData *dat)
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
if (ci.type == CNFT_ASCIIZ) {
- if (lstrlen(reinterpret_cast<TCHAR *>(ci.pszVal)) < 1 || !_tcscmp(reinterpret_cast<TCHAR *>(ci.pszVal),
+ if (mir_tstrlen(reinterpret_cast<TCHAR *>(ci.pszVal)) < 1 || !_tcscmp(reinterpret_cast<TCHAR *>(ci.pszVal),
TranslateT("'(Unknown Contact)'"))) {
mir_sntprintf(dat->szMyNickname, SIZEOF(dat->szMyNickname), _T("%s"), dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown Contact)'"));
if (ci.pszVal) {
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index e5299a53da..d7999714e6 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -114,7 +114,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex)
static void TrimMessage(TCHAR *msg)
{
- size_t iLen = lstrlen(msg) - 1;
+ size_t iLen = mir_tstrlen(msg) - 1;
size_t i = iLen;
while (i && (msg[i] == '\r' || msg[i] == '\n')) {
@@ -594,7 +594,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
}
if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead())
- dat->cache->updateStats(TSessionStats::SET_LAST_RCV, lstrlenA((char *)dbei.pBlob));
+ dat->cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob));
TCHAR *formatted = NULL;
if (rtfMessage == NULL) {
@@ -693,7 +693,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
szTemplate = isSent ? this_templateset->szTemplates[TMPL_MSGOUT] : this_templateset->szTemplates[TMPL_MSGIN];
}
- size_t iTemplateLen = lstrlen(szTemplate);
+ size_t iTemplateLen = mir_tstrlen(szTemplate);
BOOL showTime = dwEffectiveFlags & MWF_LOG_SHOWTIME;
BOOL showDate = dwEffectiveFlags & MWF_LOG_SHOWDATES;
@@ -997,7 +997,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYMISC + iFontIDOffset : MSGFONTID_YOURMISC + iFontIDOffset));
{
char *szFileName = (char *)dbei.pBlob + sizeof(DWORD);
- char *szDescr = szFileName + lstrlenA(szFileName) + 1;
+ char *szDescr = szFileName + mir_strlen(szFileName) + 1;
TCHAR *tszFileName = DbGetEventStringT(&dbei, szFileName);
if (*szDescr != 0) {
TCHAR *tszDescr = DbGetEventStringT(&dbei, szDescr);
@@ -1188,7 +1188,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
*pcb = 0;
return 0;
}
- dat->bufferLen = lstrlenA(dat->buffer);
+ dat->bufferLen = mir_strlen(dat->buffer);
}
*pcb = min(cb, dat->bufferLen - dat->bufferOffset);
CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index aa1e922fcf..f498505fec 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -109,7 +109,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if (lstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + lstrlen(fd.cFileName) - 4, _T(".tsk"), 4)) {
+ if (mir_tstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, _T(".tsk"), 4)) {
fValid = true;
break;
}
@@ -128,13 +128,13 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
GetPrivateProfileString(_T("Global"), _T("Name"), _T("None"), szBuf, 500, tszFinalName);
if (!_tcscmp(szBuf, _T("None"))) {
- fd.cFileName[lstrlen(fd.cFileName) - 4] = 0;
+ fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0;
mir_sntprintf(szBuf, 255, _T("%s"), fd.cFileName);
}
PathToRelativeT(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
- TCHAR *idata = (TCHAR*)mir_alloc((lstrlen(tszRel) + 1) * sizeof(TCHAR));
+ TCHAR *idata = (TCHAR*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(TCHAR));
_tcscpy(idata, tszRel);
SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 8356b7f1fd..93caf5f1bf 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -68,14 +68,14 @@ static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam)
return 0;
}
-//wparam = (MessageWindowInputData*)
-//lparam = (MessageWindowData*)
+//wparam = (MessageWindowInputData*)
+//lparam = (MessageWindowData*)
//returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
{
MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == NULL || (mwid->cbSize != sizeof(MessageWindowInputData)) || (mwid->hContact == NULL) || (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH))
+ if (mwid == NULL || (mwid->cbSize != sizeof(MessageWindowInputData)) || (mwid->hContact == NULL) || (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH))
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
@@ -562,16 +562,16 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
// cut nickname if larger than x chars...
TCHAR newcontactname[128], tabtitle[128];
- if (contactName && lstrlen(contactName) > 0) {
+ if (contactName && mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, SIZEOF(newcontactname));
else {
- lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname));
+ mir_tstrncpy(newcontactname, contactName, SIZEOF(newcontactname));
newcontactname[127] = 0;
}
Utils::DoubleAmpersands(newcontactname);
}
- else lstrcpyn(newcontactname, _T("_U_"), SIZEOF(newcontactname));
+ else mir_tstrncpy(newcontactname, _T("_U_"), SIZEOF(newcontactname));
WORD wStatus = (szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE));
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index 4cc465c702..efd3803e87 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -117,7 +117,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (iItem != LB_ERR) {
TCHAR szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
- if (lstrlen(szOldName) == lstrlen(szNewName)) {
+ if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
break;
@@ -132,7 +132,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
RenameContainer(iIndex, szNewName);
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
- if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && lstrlen(p->szName) == lstrlen(szName)) {
+ if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
_tcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
@@ -153,7 +153,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)- 1, (LPARAM)szNewName);
if (iItem != LB_ERR || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (lstrlen(szName) == lstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 6dd8cbb01c..abe3a03f2b 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -131,7 +131,7 @@ CSendLaterJob::~CSendLaterJob()
POPUPDATAT ppd = {0};
ppd.lchContact = hContact;
mir_sntprintf(ppd.lptzContactName, MAX_CONTACTNAME, _T("%s"), tszName ? tszName : TranslateT("'(Unknown Contact)'"));
- TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[lstrlenA((char *)pBuf) + 1]), 100);
+ TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
mir_sntprintf(ppd.lptzText, MAX_SECONDLINE, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
@@ -298,7 +298,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
DBVARIANT dbv = {0};
char *szOrig_Utf = 0;
- if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || lstrlenA(szSetting) < 8)
+ if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || mir_strlen(szSetting) < 8)
return 0;
if (szSetting[0] != 'S' && szSetting[0] != 'M')
@@ -333,7 +333,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
job->hContact = hContact;
job->created = atol(&szSetting[1]);
- int iLen = lstrlenA(szOrig_Utf);
+ int iLen = mir_strlen(szOrig_Utf);
job->sendBuffer = reinterpret_cast<char *>(mir_alloc(iLen + 1));
strncpy(job->sendBuffer, szOrig_Utf, iLen);
job->sendBuffer[iLen] = 0;
@@ -341,17 +341,17 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
// construct conventional send buffer
wchar_t *szWchar = 0;
char *szAnsi = mir_utf8decodecp(szOrig_Utf, CP_ACP, &szWchar);
- iLen = lstrlenA(szAnsi);
+ iLen = mir_strlen(szAnsi);
UINT required = iLen + 1;
if (szWchar)
- required += ((lstrlenW(szWchar) + 1) * sizeof(wchar_t));
+ required += ((mir_wstrlen(szWchar) + 1) * sizeof(wchar_t));
job->pBuf = (PBYTE)mir_calloc(required);
strncpy((char *)job->pBuf, szAnsi, iLen);
job->pBuf[iLen] = 0;
if (szWchar)
- wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, lstrlenW(szWchar));
+ wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, mir_wstrlen(szWchar));
if (szSetting[0] == 'S')
db_free(&dbv);
@@ -475,7 +475,7 @@ HANDLE CSendLater::processAck(const ACKDATA *ack)
dbei.flags = DBEF_SENT;
dbei.szModule = GetContactProto((p->hContact));
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(p->sendBuffer) + 1;
+ dbei.cbBlob = mir_strlen(p->sendBuffer) + 1;
dbei.flags |= DBEF_UTF;
dbei.pBlob = (PBYTE)(p->sendBuffer);
db_event_add(p->hContact, &dbei);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index d9a47724af..a8b9b3f271 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -127,7 +127,7 @@ entry_found:
static int SendChunkW(WCHAR *chunk, MCONTACT hContact, DWORD dwFlags)
{
- int wLen = lstrlenW(chunk);
+ int wLen = mir_wstrlen(chunk);
DWORD memRequired = (wLen + 1) * sizeof(WCHAR);
DWORD codePage = db_get_dw(hContact, SRMSGMOD_T, "ANSIcodepage", CP_ACP);
@@ -157,10 +157,10 @@ static void DoSplitSendW(LPVOID param)
int chunkSize = job->chunkSize / 2;
char *szProto = GetContactProto(hContact);
- int iLen = lstrlenA(job->szSendBuffer);
+ int iLen = mir_strlen(job->szSendBuffer);
WCHAR *wszBegin = (WCHAR*) & job->szSendBuffer[iLen + 1];
- WCHAR *wszTemp = (WCHAR*)mir_alloc(sizeof(WCHAR) * (lstrlenW(wszBegin) + 1));
- CopyMemory(wszTemp, wszBegin, sizeof(WCHAR) * (lstrlenW(wszBegin) + 1));
+ WCHAR *wszTemp = (WCHAR*)mir_alloc(sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1));
+ CopyMemory(wszTemp, wszBegin, sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1));
wszBegin = wszTemp;
do {
@@ -231,7 +231,7 @@ static void DoSplitSendA(LPVOID param)
DWORD dwFlags = job->dwFlags;
int chunkSize = job->chunkSize;
- iLen = lstrlenA(job->szSendBuffer);
+ iLen = mir_strlen(job->szSendBuffer);
szTemp = (char *)mir_alloc(iLen + 1);
CopyMemory(szTemp, job->szSendBuffer, iLen + 1);
szBegin = szTemp;
@@ -293,15 +293,15 @@ static void DoSplitSendA(LPVOID param)
int SendQueue::getSendLength(const int iEntry, int sendMode)
{
if (m_jobs[iEntry].dwFlags & PREF_UNICODE && !(sendMode & SMODE_FORCEANSI)) {
- int iLen = lstrlenA(m_jobs[iEntry].szSendBuffer);
+ int iLen = mir_strlen(m_jobs[iEntry].szSendBuffer);
WCHAR *wszBuf = (WCHAR *) & m_jobs[iEntry].szSendBuffer[iLen + 1];
char *utf8 = mir_utf8encodeT(wszBuf);
- m_jobs[iEntry].iSendLength = lstrlenA(utf8);
+ m_jobs[iEntry].iSendLength = mir_strlen(utf8);
mir_free(utf8);
return(m_jobs[iEntry].iSendLength);
}
else {
- m_jobs[iEntry].iSendLength = lstrlenA(m_jobs[iEntry].szSendBuffer);
+ m_jobs[iEntry].iSendLength = mir_strlen(m_jobs[iEntry].szSendBuffer);
return(m_jobs[iEntry].iSendLength);
}
}
@@ -487,7 +487,7 @@ void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR
dbei.eventType = EVENTTYPE_ERRMSG;
if (iSendJobIndex >= 0) {
dbei.pBlob = (BYTE *)m_jobs[iSendJobIndex].szSendBuffer;
- iMsgLen = lstrlenA(m_jobs[iSendJobIndex].szSendBuffer) + 1;
+ iMsgLen = mir_strlen(m_jobs[iSendJobIndex].szSendBuffer) + 1;
}
else {
iMsgLen = 0;
@@ -568,7 +568,7 @@ void SendQueue::recallFailed(const TWindowData *dat, int iEntry) const
/* message area is empty, so we can recall the failed message... */
SETTEXTEX stx = {ST_DEFAULT, 1200};
if (m_jobs[iEntry].dwFlags & PREF_UNICODE)
- SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)&m_jobs[iEntry].szSendBuffer[lstrlenA(m_jobs[iEntry].szSendBuffer) + 1]);
+ SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)&m_jobs[iEntry].szSendBuffer[mir_strlen(m_jobs[iEntry].szSendBuffer) + 1]);
else {
stx.codepage = (m_jobs[iEntry].dwFlags & PREF_UTF) ? CP_UTF8 : CP_ACP;
SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)m_jobs[iEntry].szSendBuffer);
@@ -618,8 +618,8 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat)
POPUPDATAT ppd = { 0 };
ppd.lchContact = dat->hContact;
- lstrcpyn(ppd.lptzContactName, dat->cache->getNick(), MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, dat->cache->getNick(), MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), MAX_SECONDLINE);
if (!(BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) {
ppd.colorText = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
@@ -641,7 +641,7 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat)
int SendQueue::RTL_Detect(const WCHAR *pszwText)
{
int i, n = 0;
- int iLen = lstrlenW(pszwText);
+ int iLen = mir_wstrlen(pszwText);
WORD *infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2));
if (infoTypeC2) {
@@ -712,7 +712,7 @@ inform_and_discard:
dbei.flags = DBEF_SENT;
dbei.szModule = GetContactProto(job.hContact);
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(job.szSendBuffer) + 1;
+ dbei.cbBlob = mir_strlen(job.szSendBuffer) + 1;
if (dat)
dat->cache->updateStats(TSessionStats::BYTES_SENT, dbei.cbBlob - 1);
@@ -810,7 +810,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.szModule = GetContactProto(dat->hContact);
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(utfText) + 1;
+ dbei.cbBlob = mir_strlen(utfText) + 1;
dbei.pBlob = (PBYTE) utfText;
StreamInEvents(dat->hwnd, 0, 1, 1, &dbei);
if (dat->hDbEventFirst == NULL)
@@ -845,7 +845,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
if (job->dwFlags & PREF_UTF || !(job->dwFlags & PREF_UNICODE)) {
char *utf_header = mir_utf8encodeT(tszHeader);
- UINT required = lstrlenA(utf_header) + lstrlenA(job->szSendBuffer) + 10;
+ UINT required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10;
char *tszMsg = reinterpret_cast<char *>(mir_alloc(required));
if (fIsSendLater) {
@@ -860,10 +860,10 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
mir_free(tszMsg);
}
else if (job->dwFlags & PREF_UNICODE) {
- int iLen = lstrlenA(job->szSendBuffer);
+ int iLen = mir_strlen(job->szSendBuffer);
wchar_t *wszMsg = (wchar_t *)&job->szSendBuffer[iLen + 1];
- UINT required = sizeof(TCHAR) * (lstrlen(tszHeader) + lstrlenW(wszMsg) + 10);
+ UINT required = sizeof(TCHAR) * (mir_tstrlen(tszHeader) + mir_wstrlen(wszMsg) + 10);
TCHAR *tszMsg = reinterpret_cast<TCHAR *>(mir_alloc(required));
if (fIsSendLater)
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index b55e905536..834cc122b5 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -148,7 +148,7 @@ const SIZE& CSideBarButton::measureItem()
HFONT oldFont = reinterpret_cast<HFONT>(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT)));
mir_sntprintf(tszLabel, 255, _T("%s"), m_dat->newtitle);
- ::GetTextExtentPoint32(dc, tszLabel, lstrlen(tszLabel), &sz);
+ ::GetTextExtentPoint32(dc, tszLabel, mir_tstrlen(tszLabel), &sz);
sz.cx += 28;
if (m_dat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON)
@@ -1180,9 +1180,9 @@ const SIZE& __fastcall CSideBar::m_measureAdvancedVertical(CSideBarButton* item)
HDC dc = ::GetDC(dat->hwnd);
HFONT hOldFont = reinterpret_cast<HFONT>(::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(dc, dat->cache->getNick(), lstrlen(dat->cache->getNick()), &szFirstLine);
+ ::GetTextExtentPoint32(dc, dat->cache->getNick(), mir_tstrlen(dat->cache->getNick()), &szFirstLine);
::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS]);
- ::GetTextExtentPoint32(dc, dat->szStatus, lstrlen(dat->szStatus), &szSecondLine);
+ ::GetTextExtentPoint32(dc, dat->szStatus, mir_tstrlen(dat->szStatus), &szSecondLine);
::SelectObject(dc, hOldFont);
ReleaseDC(dat->hwnd, dc);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 06fc9c878b..1c6f9e4af2 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -152,7 +152,7 @@ int _DebugTraceA(const char *fmt, ...)
va_list va;
va_start(va, fmt);
- lstrcpyA(debug, "TABSRMM: ");
+ mir_strcpy(debug, "TABSRMM: ");
mir_vsnprintf(&debug[9], ibsize - 10, fmt, va);
#ifdef _DEBUG
OutputDebugStringA(debug);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 0ee0234859..62cd362119 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetTextColor(dis->hDC, GetSysColor(COLOR_WINDOWTEXT));
}
char *pszName = Translate(TemplateNames[iItem]);
- TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, pszName, lstrlenA(pszName));
+ TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, pszName, (int)mir_strlen(pszName));
}
return TRUE;
@@ -357,7 +357,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dbei.szModule = "Sample error message";
dbei.cbSize = sizeof(dbei);
dbei.pBlob = (iIndex == 6) ? (BYTE *)"is now offline (was online)" : (BYTE *)"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
- dbei.cbBlob = lstrlenA((char *)dbei.pBlob) + 1;
+ dbei.cbBlob = (int)mir_strlen((char *)dbei.pBlob) + 1;
dbei.flags = (iIndex == 1 || iIndex == 3 || iIndex == 5) ? DBEF_SENT : 0;
dbei.flags |= (teInfo->rtl ? DBEF_RTL : 0);
dat->lastEventTime = (iIndex == 4 || iIndex == 5) ? time(NULL) - 1 : 0;
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 301a031f21..11a91b80d7 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -135,7 +135,7 @@ static void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTA *lf, COLORREF
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT) {
- lstrcpynA(lf->lfFaceName, "Webdings", LF_FACESIZE);
+ mir_strncpy(lf->lfFaceName, "Webdings", LF_FACESIZE);
lf->lfCharSet = SYMBOL_CHARSET;
} else
GetPrivateProfileStringA(szKey, "Face", "Tahoma", lf->lfFaceName, LF_FACESIZE - 1, szIniFilename);
@@ -287,7 +287,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
mir_snprintf(szAppname, SIZEOF(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
if (GetPrivateProfileStringA(szAppname, "Face", "Verdana", szBuf, sizeof(szBuf), szIniFilename) != 0) {
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
- lstrcpynA(szBuf, "Arial", sizeof(szBuf));
+ mir_strncpy(szBuf, "Arial", sizeof(szBuf));
db_set_s(NULL, szModule, szTemp, szBuf);
}
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 7e2e4833ae..829897679a 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1408,9 +1408,9 @@ void CSkin::Load(void)
GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
TCHAR *p = szSections;
- while (lstrlen(p) > 1) {
+ while (mir_tstrlen(p) > 1) {
if (p[0] != '%') {
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
continue;
}
for (i = 0; i <= ID_EXTBK_LAST; i++) {
@@ -1419,7 +1419,7 @@ void CSkin::Load(void)
break;
}
}
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
j++;
}
@@ -1543,7 +1543,7 @@ void CSkin::LoadItems()
szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (lstrlen(p) > 1) {
+ while (mir_tstrlen(p) > 1) {
p1 = _tcschr(p, (int)'=');
if (p1)
*p1 = 0;
@@ -1553,14 +1553,14 @@ void CSkin::LoadItems()
ZeroMemory(&m_skinIcons[m_nrSkinIcons], sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
- m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (lstrlen(p) + 1));
- lstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
+ m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(p) + 1));
+ mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
m_nrSkinIcons++;
}
}
if (p1)
*p1 = '=';
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
}
ZeroMemory(szSections, (SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
@@ -1568,10 +1568,10 @@ void CSkin::LoadItems()
szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (lstrlen(p) > 1) {
+ while (mir_tstrlen(p) > 1) {
if (p[0] == '$')
ReadImageItem(p);
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
}
nextButtonID = IDC_TBFIRSTUID;
@@ -1672,7 +1672,7 @@ void CSkin::setupAeroSkins()
TCHAR tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
_tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
- if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
+ if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
// load unknown avatar..
@@ -2443,7 +2443,7 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const
{
TCHAR tszBasePath[MAX_PATH];
mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M.getDataPath());
- if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
+ if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
CreateDirectoryTreeT(tszBasePath);
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index c495de5f87..51ed8267fb 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -308,7 +308,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con
if (!mode) {
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = lstrlen(szMenuEntry) + 1;
+ mii.cch = mir_tstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
mii.dwItemData = (ULONG_PTR)hIcon;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 2a697ce0c5..51a6d33086 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -115,16 +115,16 @@ void TN_TypingMessage(MCONTACT hContact, int iMode)
if (iMode == PROTOTYPE_CONTACTTYPING_OFF) {
if (StopDisabled)
return;
- lstrcpyn(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, szStop, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, szStop, MAX_SECONDLINE);
ppd.hNotification = hntfStopped;
notyping = 1;
}
else {
if (StartDisabled)
return;
- lstrcpyn(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, szStart, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, szStart, MAX_SECONDLINE);
ppd.hNotification = hntfStarted;
notyping = 0;
}
@@ -307,13 +307,13 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
for (i=0; i < 2; i++) {
int notyping;
if (i == PROTOTYPE_CONTACTTYPING_OFF) {
- lstrcpy(ppd.lptzContactName, TranslateT("Contact"));
- lstrcpyn(ppd.lptzText, szStop, MAX_SECONDLINE);
+ mir_tstrcpy(ppd.lptzContactName, TranslateT("Contact"));
+ mir_tstrncpy(ppd.lptzText, szStop, MAX_SECONDLINE);
notyping = 1;
}
else {
- lstrcpy(ppd.lptzContactName, TranslateT("Contact"));
- lstrcpyn(ppd.lptzText, szStart, MAX_SECONDLINE);
+ mir_tstrcpy(ppd.lptzContactName, TranslateT("Contact"));
+ mir_tstrncpy(ppd.lptzText, szStart, MAX_SECONDLINE);
notyping = 0;
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 62c99da38c..511614cd6d 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -81,7 +81,7 @@ TCHAR* Utils::FilterEventMarkers(TCHAR *wszText)
break;
}
- lstrcpy(wszText, text.c_str());
+ mir_tstrcpy(wszText, text.c_str());
return wszText;
}
@@ -126,8 +126,8 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO
search_again:
bool clr_found = false;
for (int ii = 0; ii < rtf_ctable_size; ii++) {
- if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, lstrlen(rtf_ctable[ii].szName))) {
- closing = beginmark + 7 + lstrlen(rtf_ctable[ii].szName);
+ if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
+ closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName);
if (endmark != message.npos) {
message.erase(endmark, 4);
message.replace(endmark, 4, _T("c0 "));
@@ -286,7 +286,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (tszNick[0])
title.insert(tempmark + 2, tszNick);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(tszNick);
+ curpos = tempmark + mir_tstrlen(tszNick);
break;
}
case 'p':
@@ -295,14 +295,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (szAcc)
title.insert(tempmark + 2, szAcc);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(szAcc);
+ curpos = tempmark + mir_tstrlen(szAcc);
break;
}
case 's': {
if (dat->szStatus && dat->szStatus[0])
title.insert(tempmark + 2, dat->szStatus);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(dat->szStatus);
+ curpos = tempmark + mir_tstrlen(dat->szStatus);
break;
}
case 'u': {
@@ -310,14 +310,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (szUIN[0])
title.insert(tempmark + 2, szUIN);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(szUIN);
+ curpos = tempmark + mir_tstrlen(szUIN);
break;
}
case 'c': {
TCHAR *c = (!_tcscmp(dat->pContainer->szName, _T("default")) ? TranslateT("Default container") : dat->pContainer->szName);
title.insert(tempmark + 2, c);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(c);
+ curpos = tempmark + mir_tstrlen(c);
break;
}
case 'o': {
@@ -325,7 +325,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (szProto)
title.insert(tempmark + 2, _A2T(szProto));
title.erase(tempmark, 2);
- curpos = tempmark + (szProto ? lstrlenA(szProto) : 0);
+ curpos = tempmark + (szProto ? mir_strlen(szProto) : 0);
break;
}
case 'x': {
@@ -340,11 +340,11 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
szTemp[500] = 0;
db_free(&dbv);
title.insert(tempmark + 2, szTemp);
- curpos = tempmark + lstrlen(szTemp);
+ curpos = tempmark + mir_tstrlen(szTemp);
}
else {
title.insert(tempmark + 2, xStatusDescr[xStatus - 1]);
- curpos = tempmark + lstrlen(xStatusDescr[xStatus - 1]);
+ curpos = tempmark + mir_tstrlen(xStatusDescr[xStatus - 1]);
}
}
title.erase(tempmark, 2);
@@ -368,7 +368,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (szFinalStatus) {
title.insert(tempmark + 2, szFinalStatus);
- curpos = tempmark + lstrlen(szFinalStatus);
+ curpos = tempmark + mir_tstrlen(szFinalStatus);
}
title.erase(tempmark, 2);
@@ -381,12 +381,12 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
TCHAR *tszStatusMsg = dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true);
if (tszStatusMsg) {
title.insert(tempmark + 2, tszStatusMsg);
- curpos = tempmark + lstrlen(tszStatusMsg);
+ curpos = tempmark + mir_tstrlen(tszStatusMsg);
}
else if (title[curpos] == 't') {
const TCHAR* tszStatusMsg = TranslateT("No status message");
title.insert(tempmark + 2, tszStatusMsg);
- curpos = tempmark + lstrlen(tszStatusMsg);
+ curpos = tempmark + mir_tstrlen(tszStatusMsg);
}
title.erase(tempmark, 2);
if (tszStatusMsg)
@@ -437,7 +437,7 @@ char* Utils::FilterEventMarkers(char *szText)
break;
}
//
- lstrcpyA(szText, text.c_str());
+ mir_strcpy(szText, text.c_str());
return szText;
}
@@ -707,7 +707,7 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett
WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
mir_snprintf(szCName, 40, "%s%d_theme", szSetting, pContainer->iContainerIndex);
- if (lstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
@@ -852,7 +852,7 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TC
mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
mii.dwTypeData = const_cast<TCHAR *>(szText);
- mii.cch = lstrlen(mii.dwTypeData) + 1;
+ mii.cch = mir_tstrlen(mii.dwTypeData) + 1;
::InsertMenuItem(m, pos, TRUE, &mii);
}
@@ -1018,7 +1018,7 @@ void Utils::sanitizeFilename(wchar_t* tszFilename)
{
static wchar_t *forbiddenCharacters = L"%/\\':|\"<>?";
- for (int i=0; i < lstrlenW(forbiddenCharacters); i++) {
+ for (int i=0; i < mir_wstrlen(forbiddenCharacters); i++) {
wchar_t* szFound = 0;
while ((szFound = wcschr(tszFilename, (int)forbiddenCharacters[i])) != NULL)
@@ -1032,7 +1032,7 @@ void Utils::sanitizeFilename(wchar_t* tszFilename)
void Utils::ensureTralingBackslash(wchar_t *szPathname)
{
- if (szPathname[lstrlenW(szPathname) - 1] != '\\')
+ if (szPathname[mir_wstrlen(szPathname) - 1] != '\\')
wcscat(szPathname, L"\\");
}
@@ -1052,7 +1052,7 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename)
if (wcslen(sysPathName) + wcslen(szFilename) >= MAX_PATH)
return 0;
- lstrcatW(sysPathName, szFilename);
+ mir_wstrcat(sysPathName, szFilename);
HMODULE _h = LoadLibraryW(sysPathName);
if (0 == _h)
return 0;
@@ -1077,7 +1077,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner)
if (!OpenClipboard(hwndOwner) || str == 0)
return 0;
- size_t i = sizeof(TCHAR) * (lstrlen(str) + 1);
+ size_t i = sizeof(TCHAR) * (mir_tstrlen(str) + 1);
EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
@@ -1102,15 +1102,15 @@ void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename
WIN32_FIND_DATA fd;
HANDLE hFind;
TCHAR szPath[MAX_PATH];
- lstrcpy(szPath, szFilename);
- lstrcat(szPath, _T("\\*"));
+ mir_tstrcpy(szPath, szFilename);
+ mir_tstrcat(szPath, _T("\\*"));
if ((hFind = FindFirstFile(szPath, &fd)) != INVALID_HANDLE_VALUE) {
do {
if (!lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T("..")))
continue;
- lstrcpy(szPath, szFilename);
- lstrcat(szPath, _T("\\"));
- lstrcat(szPath, fd.cFileName);
+ mir_tstrcpy(szPath, szFilename);
+ mir_tstrcat(szPath, _T("\\"));
+ mir_tstrcat(szPath, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
}
while (FindNextFile(hFind, &fd));
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp
index a969d48251..6ad04e4af4 100644
--- a/plugins/TipperYM/src/message_pump.cpp
+++ b/plugins/TipperYM/src/message_pump.cpp
@@ -327,7 +327,7 @@ int ProtoAck(WPARAM wParam, LPARAM lParam)
if (ack->type == ACKTYPE_AWAYMSG) {
TCHAR *tszMsg = (TCHAR*)ack->lParam;
- if (lstrlen(tszMsg))
+ if (mir_tstrlen(tszMsg))
PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_tstrdup(tszMsg));
}
else if (ack->type == ICQACKTYPE_XSTATUS_RESPONSE)
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp
index 074df144f1..2086ef13b8 100644
--- a/plugins/TipperYM/src/mir_smileys.cpp
+++ b/plugins/TipperYM/src/mir_smileys.cpp
@@ -41,7 +41,7 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto
return NULL;
if (nCount == -1)
- nCount = lstrlen(lpString);
+ nCount = mir_tstrlen(lpString);
SMILEYPARSEINFO info = (SMILEYPARSEINFO) mir_calloc(sizeof(tagSMILEYPARSEINFO));
info->pieces = ReplaceSmileys(lpString, nCount, protocol, &info->max_height);
@@ -72,7 +72,7 @@ void Smileys_FreeParse(SMILEYPARSEINFO parseInfo)
int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol, SMILEYPARSEINFO parseInfo)
{
if (nCount == -1)
- nCount = lstrlen(lpString);
+ nCount = mir_tstrlen(lpString);
if (uFormat & DT_CALCRECT) {
SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp
index fd7610bc59..d55ad2c156 100644
--- a/plugins/TooltipNotify/src/Tooltip.cpp
+++ b/plugins/TooltipNotify/src/Tooltip.cpp
@@ -84,7 +84,7 @@ LRESULT CALLBACK CTooltip::WindowProc(HWND hWnd, UINT message, WPARAM wParam, LP
SetBkMode(hDC, TRANSPARENT);
SetTextColor(hDC, m_dwTextColor);
SelectObject(hDC, m_hFont);
- DrawText(hDC, m_szText, lstrlen(m_szText), &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+ DrawText(hDC, m_szText, mir_tstrlen(m_szText), &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
EndPaint(hWnd, &ps);
@@ -147,7 +147,7 @@ void CTooltip::Validate()
SIZE Size;
HDC hDC = GetDC(m_hWnd);
SelectObject(hDC, m_hFont);
- GetTextExtentPoint32(hDC, m_szText, lstrlen(m_szText), &Size);
+ GetTextExtentPoint32(hDC, m_szText, mir_tstrlen(m_szText), &Size);
SetWindowPos(m_hWnd, 0, 0, 0, Size.cx+6, Size.cy+4,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW);
ReleaseDC(m_hWnd, hDC);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index b46e11d61d..4a44de9750 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.cpp
+++ b/plugins/TooltipNotify/src/TooltipNotify.cpp
@@ -725,7 +725,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
ListView_GetItemText(GetDlgItem(hDlg,IDC_PROTOS), i, 0, szProto, SIZEOF(szProto));
char szMultiByteProto[128];
- long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, lstrlen(szProto),
+ long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, mir_tstrlen(szProto),
szMultiByteProto, sizeof(szMultiByteProto), NULL, NULL);
szMultiByteProto[lLen] = '\0';
@@ -869,26 +869,26 @@ TCHAR *CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize
{
if((iStatus>=ID_STATUS_OFFLINE) && (iStatus<=ID_STATUS_OUTTOLUNCH))
{
- lstrcpyn(szStatus, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,iStatus,GSMDF_TCHAR), iBufSize);
+ mir_tstrncpy(szStatus, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,iStatus,GSMDF_TCHAR), iBufSize);
}
else
{
switch(iStatus)
{
case ID_TTNTF_STATUS_TYPING:
- lstrcpyn(szStatus, TranslateT("Typing"), iBufSize);
+ mir_tstrncpy(szStatus, TranslateT("Typing"), iBufSize);
break;
case ID_TTNTF_STATUS_IDLE:
- lstrcpyn(szStatus, TranslateT("Idle"), iBufSize);
+ mir_tstrncpy(szStatus, TranslateT("Idle"), iBufSize);
break;
case ID_TTNTF_STATUS_NOT_IDLE:
- lstrcpyn(szStatus, TranslateT("Not Idle"), iBufSize);
+ mir_tstrncpy(szStatus, TranslateT("Not Idle"), iBufSize);
break;
default:
- lstrcpyn(szStatus, TranslateT("Unknown"), iBufSize);
+ mir_tstrncpy(szStatus, TranslateT("Unknown"), iBufSize);
break;
}
}
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp
index 342a5557a9..50aa0b2ac9 100644
--- a/plugins/TrafficCounter/src/TrafficCounter.cpp
+++ b/plugins/TrafficCounter/src/TrafficCounter.cpp
@@ -213,8 +213,8 @@ int TrafficCounterModulesLoaded(WPARAM wParam, LPARAM lParam)
// Ôîðìàò ñ÷¸ò÷èêà äëÿ êàæäîãî àêòèâíîãî ïðîòîêîëà
if (db_get_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, &dbv) == 0)
{
- if(lstrlen(dbv.ptszVal) > 0)
- lstrcpyn(Traffic_CounterFormat, dbv.ptszVal, SIZEOF(Traffic_CounterFormat));
+ if(mir_tstrlen(dbv.ptszVal) > 0)
+ mir_tstrncpy(Traffic_CounterFormat, dbv.ptszVal, SIZEOF(Traffic_CounterFormat));
//
db_free(&dbv);
}
@@ -231,8 +231,8 @@ int TrafficCounterModulesLoaded(WPARAM wParam, LPARAM lParam)
// Ôîðìàò âñïëûâàþùèõ ïîäñêàçîê
if (db_get_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, &dbv) == 0)
{
- if(lstrlen(dbv.ptszVal) > 0)
- lstrcpyn(Traffic_TooltipFormat, dbv.ptszVal, SIZEOF(Traffic_TooltipFormat));
+ if(mir_tstrlen(dbv.ptszVal) > 0)
+ mir_tstrncpy(Traffic_TooltipFormat, dbv.ptszVal, SIZEOF(Traffic_TooltipFormat));
//
db_free(&dbv);
}
@@ -392,7 +392,7 @@ int TrafficCounter_Draw(HWND hwnd, HDC hDC)
static void TC_AlphaText(HDC hDC, LPCTSTR lpString, RECT* lpRect, UINT format, BYTE ClistModernPresent)
{
- int nCount = lstrlen( lpString );
+ int nCount = mir_tstrlen( lpString );
if (ClistModernPresent)
AlphaText(hDC, lpString, nCount, lpRect, format, Traffic_FontColor);
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp
index 34d7c9f418..57e9dfdcaa 100644
--- a/plugins/TrafficCounter/src/opttree.cpp
+++ b/plugins/TrafficCounter/src/opttree.cpp
@@ -109,7 +109,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconInd
int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
- lstrcpy(itemName, name);
+ mir_tstrcpy(itemName, name);
sectionName = itemName;
while (sectionName)
@@ -193,7 +193,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
HTREEITEM hSection = NULL;
if (options[indx].szOptionName)
- lstrcpy(itemName, options[indx].szOptionName);
+ mir_tstrcpy(itemName, options[indx].szOptionName);
else
itemName[0] = 0;
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp
index c5697bb615..f0d7764e0e 100644
--- a/plugins/TranslitSwitcher/src/Layoutproc.cpp
+++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp
@@ -400,7 +400,7 @@ VOID SwitchLayout(bool lastword)
event.iType = IEE_GET_SELECTION;
event.hwnd = hwnd3;
selected = (TCHAR *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
- lstrcpy(buf, selected);
+ mir_tstrcpy(buf, selected);
}
else
SendMessage(hwnd2, WM_GETTEXT, SIZEOF(buf), (LPARAM)buf); // gimme, gimme, gimme...
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp
index e9d8944e13..6748e4de04 100644
--- a/plugins/UserInfoEx/src/psp_profile.cpp
+++ b/plugins/UserInfoEx/src/psp_profile.cpp
@@ -826,7 +826,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa
// calculate size of text on the screen
if ((hDC = GetDC(GetParent(hwnd)))) {
SelectObject(hDC, (HFONT)SendMessage(GetParent(hwnd), WM_GETFONT, NULL, NULL));
- GetTextExtentPoint32(hDC, pItem->pszText[hi.iSubItem], lstrlen(pItem->pszText[hi.iSubItem]), &textSize);
+ GetTextExtentPoint32(hDC, pItem->pszText[hi.iSubItem], mir_tstrlen(pItem->pszText[hi.iSubItem]), &textSize);
ReleaseDC(GetParent(hwnd), hDC);
}
// show tip only for text that is larger than te listview can display
diff --git a/plugins/Utils/mir_buffer.h b/plugins/Utils/mir_buffer.h
index 45c8af0e20..6dc35c0a88 100644
--- a/plugins/Utils/mir_buffer.h
+++ b/plugins/Utils/mir_buffer.h
@@ -41,7 +41,7 @@ static inline size_t __blen<char>(const char *str)
template<>
static inline size_t __blen<wchar_t>(const wchar_t *str)
{
- return lstrlenW(str);
+ return mir_wstrlen(str);
}
template<class T>
@@ -479,7 +479,7 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
{
for(int k = 0; k < numVariables; k += 2)
{
- size_t len = lstrlen(variables[k]);
+ size_t len = mir_tstrlen(variables[k]);
if (foundLen == len + 2 && _tcsncmp(&buffer->str[j]+1, variables[k], len) == 0)
{
buffer->replace(j, i + 1, variables[k + 1]);
diff --git a/plugins/Utils/mir_fonts.cpp b/plugins/Utils/mir_fonts.cpp
index 214e922d91..d43b8ddab4 100644
--- a/plugins/Utils/mir_fonts.cpp
+++ b/plugins/Utils/mir_fonts.cpp
@@ -11,10 +11,10 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const
FontIDT fid;
ZeroMemory(&fid,sizeof(fid));
fid.cbSize=sizeof(fid);
- lstrcpynA(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
- lstrcpynA(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
- lstrcpyn(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */
- lstrcpyn(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
+ mir_strncpy(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
+ mir_strncpy(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
+ mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */
+ mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
fid.flags=FIDF_ALLOWREREGISTER;
if(bAllowEffects) fid.flags|=FIDF_ALLOWEFFECTS;
fid.order=position;
@@ -27,7 +27,7 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const
if(plfDefault->lfUnderline) fid.deffontsettings.style|=DBFONTF_UNDERLINE;
if(plfDefault->lfStrikeOut) fid.deffontsettings.style|=DBFONTF_STRIKEOUT;
fid.deffontsettings.charset=plfDefault->lfCharSet;
- lstrcpyn(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */
+ mir_tstrncpy(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */
}
FontRegisterT(&fid);
return 0;
@@ -37,8 +37,8 @@ int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLO
{
FontIDT fid;
fid.cbSize=sizeof(fid);
- lstrcpyn(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */
- lstrcpyn(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
+ mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */
+ mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
*pclr=(COLORREF)CallService(MS_FONT_GETT,(WPARAM)&fid,(LPARAM)plf); /* uses fallback font on error */
return (int)*pclr==-1;
}
@@ -49,10 +49,10 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons
ZeroMemory(&cid,sizeof(cid));
cid.cbSize=sizeof(cid);
cid.defcolour=clrDefault;
- lstrcpynA(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
- lstrcpynA(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */
- lstrcpyn(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */
- lstrcpyn(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */
+ mir_strncpy(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
+ mir_strncpy(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */
+ mir_tstrncpy(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */
+ mir_tstrncpy(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */
ColourRegisterT(&cid);
return 0;
}
@@ -62,8 +62,8 @@ int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COL
ColourIDT cid;
ZeroMemory(&cid,sizeof(cid));
cid.cbSize=sizeof(cid);
- lstrcpyn(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
- lstrcpyn(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
+ mir_tstrncpy(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
+ mir_tstrncpy(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
*pclr=(COLORREF)CallService(MS_COLOUR_GETT,(WPARAM)&cid,0);
return (int)*pclr==-1;
}
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp
index 9f0aabd22a..59b9ff6748 100644
--- a/plugins/Utils/mir_options.cpp
+++ b/plugins/Utils/mir_options.cpp
@@ -40,12 +40,12 @@ static TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char
out[0] = _T('\0');
if (!db_get_ts(hContact, module, setting, &dbv)) {
- lstrcpyn(out, dbv.ptszVal, (int)len);
+ mir_tstrncpy(out, dbv.ptszVal, (int)len);
db_free(&dbv);
}
else {
if (def != NULL)
- lstrcpyn(out, def, (int)len);
+ mir_tstrncpy(out, def, (int)len);
}
return out;
@@ -57,7 +57,7 @@ static TCHAR dbPath[MAX_PATH] = { 0 }; // database profile path (read at startu
static int PathIsAbsolute(const TCHAR *path)
{
- if (!path || !(lstrlen(path) > 2))
+ if (!path || !(mir_tstrlen(path) > 2))
return 0;
if ((path[1] == _T(':') && path[2] == _T('\\')) || (path[0] == _T('\\') && path[1] == _T('\\')))
return 1;
@@ -67,7 +67,7 @@ static int PathIsAbsolute(const TCHAR *path)
static void PathToRelative(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
{
if (!PathIsAbsolute(pSrc))
- lstrcpyn(pOut, pSrc, (int)outSize);
+ mir_tstrncpy(pOut, pSrc, (int)outSize);
else {
if (dbPath[0] == _T('\0')) {
char tmp[1024];
@@ -75,18 +75,18 @@ static void PathToRelative(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
mir_sntprintf(dbPath, SIZEOF(dbPath), _T("%S\\"), tmp);
}
- size_t len = lstrlen(dbPath);
+ size_t len = mir_tstrlen(dbPath);
if (_tcsnicmp(pSrc, dbPath, len))
mir_sntprintf(pOut, outSize, _T("%s"), pSrc + len);
else
- lstrcpyn(pOut, pSrc, (int)outSize);
+ mir_tstrncpy(pOut, pSrc, (int)outSize);
}
}
static void PathToAbsolute(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
{
if (PathIsAbsolute(pSrc) || !isalnum(pSrc[0]))
- lstrcpyn(pOut, pSrc, (int)outSize);
+ mir_tstrncpy(pOut, pSrc, (int)outSize);
else {
if (dbPath[0] == _T('\0')) {
char tmp[1024];
diff --git a/plugins/Utils/mir_smileys.cpp b/plugins/Utils/mir_smileys.cpp
index 9eedd165fb..051f30f2fc 100644
--- a/plugins/Utils/mir_smileys.cpp
+++ b/plugins/Utils/mir_smileys.cpp
@@ -223,7 +223,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText
RECT text_rc = {0, 0, 0x7FFFFFFF, 0x7FFFFFFF};
// Always need cy...
- DrawText(hdcMem,szText,lstrlen(szText), &text_rc, DT_CALCRECT | uTextFormat);
+ DrawText(hdcMem,szText,mir_tstrlen(szText), &text_rc, DT_CALCRECT | uTextFormat);
text_size.cy = text_rc.bottom - text_rc.top;
if (plText == NULL)
diff --git a/plugins/Variables/src/parse_regexp.cpp b/plugins/Variables/src/parse_regexp.cpp
index acb4a1c642..025daeb84a 100644
--- a/plugins/Variables/src/parse_regexp.cpp
+++ b/plugins/Variables/src/parse_regexp.cpp
@@ -39,7 +39,7 @@ static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai)
return NULL;
pcre16_extra *extra = pcre16_study(ppat, 0, &err);
- int nmat = pcre16_exec(ppat, extra, ai->targv[2], lstrlen(ai->targv[2]), 0, 0, offsets, 99);
+ int nmat = pcre16_exec(ppat, extra, ai->targv[2], mir_tstrlen(ai->targv[2]), 0, 0, offsets, 99);
if (nmat > 0) {
ai->flags &= ~AIF_FALSE;
_ltoa(nmat, szVal, 10);
@@ -72,7 +72,7 @@ static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai)
return NULL;
pcre16_extra *extra = pcre16_study(ppat, 0, &err);
- int nmat = pcre16_exec(ppat, extra, ai->targv[2], lstrlen(ai->targv[2]), 0, 0, offsets, 99);
+ int nmat = pcre16_exec(ppat, extra, ai->targv[2], mir_tstrlen(ai->targv[2]), 0, 0, offsets, 99);
if (nmat >= 0)
ai->flags &= ~AIF_FALSE;
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp
index 3329dcfe3a..61904d5a9e 100644
--- a/plugins/WebView/src/webview.cpp
+++ b/plugins/WebView/src/webview.cpp
@@ -252,10 +252,10 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb
cfFM.dwEffects = bold | italic | underline;
if (!db_get_ts(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
- lstrcpy(cfFM.szFaceName, dbv.ptszVal);
+ mir_tstrcpy(cfFM.szFaceName, dbv.ptszVal);
db_free(&dbv);
}
- else lstrcpy(cfFM.szFaceName, Def_font_face);
+ else mir_tstrcpy(cfFM.szFaceName, Def_font_face);
HDC hDC = GetDC(hWindow);
cfFM.yHeight = (BYTE)MulDiv(abs(lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (db_get_b(NULL, MODULENAME, FONT_SIZE_KEY, 14));
@@ -338,7 +338,7 @@ void FontSettings(void)
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
- lstrcpy(lf.lfFaceName, Def_font_face);
+ mir_tstrcpy(lf.lfFaceName, Def_font_face);
}
/*****************************************************************************/
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp
index 35378816ba..6d879a0b42 100644
--- a/plugins/WebView/src/webview_alerts.cpp
+++ b/plugins/WebView/src/webview_alerts.cpp
@@ -116,10 +116,10 @@ int PopupAlert(WPARAM wParam, LPARAM lParam)
if( ((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
db_get_ts(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
- lstrcpyn(ppd.lptzContactName, dbv.ptszVal, SIZEOF(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzContactName, dbv.ptszVal, SIZEOF(ppd.lptzContactName));
db_free(&dbv);
}
- else lstrcpy(ppd.lptzContactName, _T(MODULENAME));
+ else mir_tstrcpy(ppd.lptzContactName, _T(MODULENAME));
ppd.lchContact = wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
diff --git a/plugins/WebView/src/webview_cleanup.cpp b/plugins/WebView/src/webview_cleanup.cpp
index bf34ef46d5..f6336cb83f 100644
--- a/plugins/WebView/src/webview_cleanup.cpp
+++ b/plugins/WebView/src/webview_cleanup.cpp
@@ -689,10 +689,10 @@ void FastTagFilter(char *truncated)
if (truncated)
strncpy(tempraw, truncated, MAXSIZE1);
- for (int counter = 0; counter < lstrlenA(tempraw); counter++) {
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++) {
if (tempraw[counter] == '<') {
while (tempraw[counter] != '>') {
- if (counter >= lstrlenA(tempraw))
+ if (counter >= mir_strlen(tempraw))
break;
tempraw[counter] = ' ';
@@ -729,7 +729,7 @@ void RemoveInvis(char *truncated, int AmountWspcRem)
break;
}
- for (int counter = 0; counter < lstrlenA(tempraw); counter++) {
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++) {
if (AmountWspcRem != 0 && AmountWspcRem != 4) {
if ((tempraw[counter] == '\n') || (tempraw[counter] == ' ') || (tempraw[counter] == '\r'))
erase = erase + 1;
@@ -756,7 +756,7 @@ void RemoveTabs(char *truncated)
if (truncated)
strncpy(tempraw, truncated, MAXSIZE1);
- for (int counter = 0; counter < lstrlenA(tempraw); counter++)
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++)
if (tempraw[counter] == '\t')
tempraw[counter] = ' ';
@@ -770,7 +770,7 @@ void Removewhitespace(char *truncated)
int counter2 = 0;
int pos1 = 0, pos2 = 0;
- for (int counter = 0; counter < lstrlenA(truncated); counter++) {
+ for (int counter = 0; counter < mir_strlen(truncated); counter++) {
if (truncated[counter] == ' ' && truncated[counter + 1] == ' ') {
pos1 = counter + 1;
counter2 = counter;
@@ -790,7 +790,7 @@ void Filter(char *truncated)
char tempraw[MAXSIZE1];
strncpy(tempraw, truncated, SIZEOF(tempraw));
- for (int counter = 0; counter < lstrlenA(tempraw); counter++)
+ for (int counter = 0; counter < mir_strlen(tempraw); counter++)
if ((tempraw[counter] == '\n') || (tempraw[counter] == '\r') || (tempraw[counter] == '\t'))
strncpy(&tempraw[counter], &tempraw[counter + 1], strlen(&tempraw[counter]) - 1);
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp
index a7dee35823..2731f9a263 100644
--- a/plugins/WebView/src/webview_datawnd.cpp
+++ b/plugins/WebView/src/webview_datawnd.cpp
@@ -62,10 +62,10 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
free(tempbuffer);
Filter(buff);
- CharUpperBuffA(buff, lstrlenA(buff));
+ CharUpperBuffA(buff, mir_strlen(buff));
GetDlgItemTextA(hwndDlg, IDC_FINDWHAT, NewSearchstr, SIZEOF(NewSearchstr));
- CharUpperBuffA(NewSearchstr, lstrlenA(NewSearchstr));
+ CharUpperBuffA(NewSearchstr, mir_strlen(NewSearchstr));
OLDstartposition = startposition;
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp
index eef98ee250..9de894fd3e 100644
--- a/plugins/WebView/src/webview_getdata.cpp
+++ b/plugins/WebView/src/webview_getdata.cpp
@@ -37,7 +37,6 @@ void GetData(void *param)
int MallocSize = 0;
int DownloadSuccess = 0;
char*raw;
- char*szInfo;
char truncated[MAXSIZE1];
char truncated2[MAXSIZE2];
int trunccount = 0;
@@ -64,7 +63,6 @@ void GetData(void *param)
ZeroMemory(&contactname, sizeof(contactname));
ZeroMemory(&tempstring, sizeof(tempstring));
ZeroMemory(&tempstring2, sizeof(tempstring2));
- ZeroMemory(&szInfo, sizeof(szInfo));
ZeroMemory(&dbv, sizeof(dbv));
ZeroMemory(&tstr, sizeof(tstr));
ZeroMemory(&timestring, sizeof(timestring));
@@ -148,13 +146,13 @@ void GetData(void *param)
db_set_ts(hContact, "CList", "StatusMsg", statusText);
}
if (nlhrReply->dataLength) {
- int cbLen = lstrlenA(nlhrReply->pData);
- szInfo = (char*)malloc(cbLen + 2);
- lstrcpynA(szInfo, nlhrReply->pData, cbLen);
- downloadsize = lstrlenA(nlhrReply->pData);
+ size_t cbLen = mir_strlen(nlhrReply->pData);
+ char *szInfo = (char*)malloc(cbLen + 2);
+ mir_strncpy(szInfo, nlhrReply->pData, cbLen);
+ downloadsize = mir_strlen(nlhrReply->pData);
trunccount = 0;
- lstrcpynA(truncated2, szInfo, MAXSIZE2);
+ mir_strncpy(truncated2, szInfo, MAXSIZE2);
free(szInfo);
////////////////////////////////////////////
@@ -193,7 +191,7 @@ void GetData(void *param)
if (DownloadSuccess) {
// all the site
if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 1)
- lstrcpynA(truncated, truncated2, MAXSIZE1);
+ mir_strncpy(truncated, truncated2, MAXSIZE1);
else { // use start and end string
// putting data into string
if (((strstr(truncated2, tempstring)) != 0) && ((strstr(truncated2, tempstring2)) != 0)) {
@@ -240,7 +238,7 @@ void GetData(void *param)
trunccount = 0;
- lstrcpynA(truncated, raw, MAXSIZE1);
+ mir_strncpy(truncated, raw, MAXSIZE1);
free(raw);
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp
index 1b9e8ae0e7..924b8ab9e6 100644
--- a/plugins/WebView/src/webview_services.cpp
+++ b/plugins/WebView/src/webview_services.cpp
@@ -225,7 +225,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM)
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- lstrcpynA((char*) lParam, MODULENAME, wParam);
+ mir_strncpy((char*) lParam, MODULENAME, wParam);
return 0;
}
@@ -248,7 +248,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
bpStatus = wParam;
ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, wParam);
-
+
// Make sure no contact has offline status for any reason on first time run
if ( db_get_b(NULL, MODULENAME, "FirstTime", 100) == 100) {
for (MCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
@@ -319,12 +319,12 @@ INT_PTR BasicSearch(WPARAM wParam, LPARAM lParam)
static TCHAR buf[300];
if (lParam)
- lstrcpyn(buf, (const TCHAR*) lParam, 256);
+ mir_tstrncpy(buf, (const TCHAR*) lParam, 256);
if (searchId != -1)
return 0; // only one search at a time
- lstrcpyn(sID, (TCHAR*)lParam, SIZEOF(sID));
+ mir_tstrncpy(sID, (TCHAR*)lParam, SIZEOF(sID));
searchId = 1;
// create a thread for the ID search
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
index 6d7c207b70..9ac45b6711 100644
--- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp
+++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
@@ -137,8 +137,8 @@ void ShowThePopup(PWumf w, LPTSTR title, LPTSTR text)
else if (WumfOptions.DelaySet)
ppd.iSeconds = WumfOptions.DelaySec;
- lstrcpyn(ppd.lptzContactName, title, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, text, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, title, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, text, MAX_SECONDLINE);
if (WumfOptions.UseWinColor) {
ppd.colorBack = GetSysColor(COLOR_WINDOW);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -275,7 +275,7 @@ void ChooseFile(HWND hDlg)
HANDLE hf = CreateFile(szFile,GENERIC_WRITE,0,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL, NULL);
if (hf != INVALID_HANDLE_VALUE) {
SetDlgItemText(hDlg,IDC_FILE,szFile);
- lstrcpyn(WumfOptions.LogFile, szFile, MAX_PATH);
+ mir_tstrncpy(WumfOptions.LogFile, szFile, MAX_PATH);
CloseHandle(hf);
}
}
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp
index 7470a1b969..32b44dcd33 100644
--- a/plugins/YAMN/src/account.cpp
+++ b/plugins/YAMN/src/account.cpp
@@ -1250,7 +1250,7 @@ void WINAPI GetStatusFcn(HACCOUNT Which,TCHAR *Value)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tGetStatus:AccountStatusCS-cs enter\n");
#endif
- lstrcpy(Value,Which->Status);
+ mir_tstrcpy(Value,Which->Status);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tGetStatus:AccountStatusCS-cs done\n");
#endif
@@ -1270,7 +1270,7 @@ void WINAPI SetStatusFcn(HACCOUNT Which,TCHAR *Value)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tSetStatus:AccountStatusCS-cs enter\n");
#endif
- lstrcpy(Which->Status,Value);
+ mir_tstrcpy(Which->Status,Value);
WindowList_BroadcastAsync(YAMNVar.MessageWnds,WM_YAMN_CHANGESTATUS,(WPARAM)Which,0);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tSetStatus:AccountStatusCS-cs done\n");
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp
index f113392917..3387028fc8 100644
--- a/plugins/YAMN/src/browser/badconnect.cpp
+++ b/plugins/YAMN/src/browser/badconnect.cpp
@@ -38,11 +38,11 @@ LRESULT CALLBACK BadConnectPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPa
Command = new WCHAR[wcslen(ActualAccount->BadConnectN.App)+6];
if (Command != NULL) {
- lstrcpyW(Command,L"\"");
- lstrcatW(Command,ActualAccount->BadConnectN.App);
- lstrcatW(Command,L"\" ");
+ mir_wstrcpy(Command,L"\"");
+ mir_wstrcat(Command,ActualAccount->BadConnectN.App);
+ mir_wstrcat(Command,L"\" ");
if (ActualAccount->BadConnectN.AppParam != NULL)
- lstrcatW(Command,ActualAccount->BadConnectN.AppParam);
+ mir_wstrcat(Command,ActualAccount->BadConnectN.AppParam);
CreateProcessW(NULL,Command,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
delete[] Command;
}
@@ -119,13 +119,13 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
BadConnectPopup.PluginWindowProc = BadConnectPopupProc;
BadConnectPopup.PluginData = ActualAccount;
- lstrcpyn(BadConnectPopup.lptzContactName, _A2T(ActualAccount->Name), SIZEOF(BadConnectPopup.lptzContactName));
+ mir_tstrncpy(BadConnectPopup.lptzContactName, _A2T(ActualAccount->Name), SIZEOF(BadConnectPopup.lptzContactName));
}
if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr != NULL) {
Message1W = ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg,IDC_STATICMSG,Message1W);
- lstrcpyn(BadConnectPopup.lptzText,Message1W,sizeof(BadConnectPopup.lptzText));
+ mir_tstrncpy(BadConnectPopup.lptzText,Message1W,sizeof(BadConnectPopup.lptzText));
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -133,7 +133,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
{
Message1W=ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg,IDC_STATICMSG,Message1W);
- lstrcpyn(BadConnectPopup.lptzText,Message1W,sizeof(BadConnectPopup.lptzText));
+ mir_tstrncpy(BadConnectPopup.lptzText,Message1W,sizeof(BadConnectPopup.lptzText));
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -141,7 +141,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
{
Message1W=TranslateT("Unknown error");
SetDlgItemText(hDlg,IDC_STATICMSG,Message1W);
- lstrcpyn(BadConnectPopup.lptzText,Message1W,sizeof(BadConnectPopup.lptzText));
+ mir_tstrncpy(BadConnectPopup.lptzText,Message1W,sizeof(BadConnectPopup.lptzText));
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index cda180d5ac..c983eadddf 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -601,8 +601,8 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb
}
if ((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW)) {
- lstrcpyn(NewMailPopup.lptzContactName, FromStr, SIZEOF(NewMailPopup.lptzContactName));
- lstrcpyn(NewMailPopup.lptzText, UnicodeHeader.Subject, SIZEOF(NewMailPopup.lptzText));
+ mir_tstrncpy(NewMailPopup.lptzContactName, FromStr, SIZEOF(NewMailPopup.lptzContactName));
+ mir_tstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, SIZEOF(NewMailPopup.lptzText));
PYAMN_MAILSHOWPARAM MailParam = (PYAMN_MAILSHOWPARAM)malloc(sizeof(YAMN_MAILSHOWPARAM));
if (MailParam) {
@@ -690,7 +690,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
NewMailPopup.PluginWindowProc = NewMailPopupProc;
NewMailPopup.PluginData = (void *)0; //multiple popups
- lstrcpyn(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), SIZEOF(NewMailPopup.lptzContactName));
+ mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), SIZEOF(NewMailPopup.lptzContactName));
mir_sntprintf(NewMailPopup.lptzText, SIZEOF(NewMailPopup.lptzText), TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
PUAddPopupT(&NewMailPopup);
}
@@ -764,11 +764,11 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
if (Command != NULL)
{
- lstrcpyW(Command,L"\"");
- lstrcatW(Command,ActualAccount->NewMailN.App);
- lstrcatW(Command,L"\" ");
+ mir_wstrcpy(Command,L"\"");
+ mir_wstrcat(Command,ActualAccount->NewMailN.App);
+ mir_wstrcat(Command,L"\" ");
if (ActualAccount->NewMailN.AppParam != NULL)
- lstrcatW(Command,ActualAccount->NewMailN.AppParam);
+ mir_wstrcat(Command,ActualAccount->NewMailN.AppParam);
CreateProcessW(NULL,Command,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
delete[] Command;
}
@@ -793,11 +793,11 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
NoNewMailPopup.PluginWindowProc=NoNewMailPopupProc;
NoNewMailPopup.PluginData=(void *)0; //it's not new mail popup
- lstrcpyn(NoNewMailPopup.lptzContactName,_A2T(ActualAccount->Name),SIZEOF(NoNewMailPopup.lptzContactName));
+ mir_tstrncpy(NoNewMailPopup.lptzContactName,_A2T(ActualAccount->Name),SIZEOF(NoNewMailPopup.lptzContactName));
if (MN->Real.PopupSL2NC+MN->Virtual.PopupSL2NC)
mir_sntprintf(NoNewMailPopup.lptzText, SIZEOF(NoNewMailPopup.lptzText), TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC);
else
- lstrcpyn(NoNewMailPopup.lptzText,TranslateT("No new mail message"),SIZEOF(NoNewMailPopup.lptzText));
+ mir_tstrncpy(NoNewMailPopup.lptzText,TranslateT("No new mail message"),SIZEOF(NoNewMailPopup.lptzText));
PUAddPopupT(&NoNewMailPopup);
}
@@ -2077,11 +2077,11 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (Command != NULL)
{
- lstrcpyW(Command,L"\"");
- lstrcatW(Command,ActualAccount->NewMailN.App);
- lstrcatW(Command,L"\" ");
+ mir_wstrcpy(Command,L"\"");
+ mir_wstrcat(Command,ActualAccount->NewMailN.App);
+ mir_wstrcat(Command,L"\" ");
if (ActualAccount->NewMailN.AppParam != NULL)
- lstrcatW(Command,ActualAccount->NewMailN.AppParam);
+ mir_wstrcat(Command,ActualAccount->NewMailN.AppParam);
CreateProcessW(NULL,Command,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
delete[] Command;
}
diff --git a/plugins/YAMN/src/mails/mails.cpp b/plugins/YAMN/src/mails/mails.cpp
index 716d1905f0..70fa4f8321 100644
--- a/plugins/YAMN/src/mails/mails.cpp
+++ b/plugins/YAMN/src/mails/mails.cpp
@@ -417,9 +417,9 @@ void WINAPI TranslateHeaderFcn(char *stream,int len,struct CMimeItem **head)
Item->Next=NULL;
Item->name=new char [prev2-prev1+1];
- lstrcpynA(Item->name,prev1,prev2-prev1+1);
+ mir_strncpy(Item->name,prev1,prev2-prev1+1);
Item->value=new char [finder-prev3+1];
- lstrcpynA(Item->value,prev3,finder-prev3+1);
+ mir_strncpy(Item->value,prev3,finder-prev3+1);
if (EOS(finder))
break;
@@ -440,7 +440,7 @@ void WINAPI TranslateHeaderFcn(char *stream,int len,struct CMimeItem **head)
Item->Next=NULL;//just in case;
Item->name=new char[5]; strncpy(Item->name,"Body",5);
Item->value=new char [prev2-prev1];
- lstrcpynA(Item->value,prev1,prev2-prev1-1);
+ mir_strncpy(Item->value,prev1,prev2-prev1-1);
}
break; // there is nothing else
}
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 14b1a8af9c..369940ae67 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -220,7 +220,7 @@ static void LoadPlugins()
continue;
// we have a dot
- int len = lstrlen(fd.cFileName); // find the length of the string
+ int len = mir_tstrlen(fd.cFileName); // find the length of the string
TCHAR* end = fd.cFileName+len; // get a pointer to the NULL
int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
index 7dbdaff8ee..455a981ca0 100644
--- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
@@ -684,7 +684,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)TranslateT("Default"));
for (i=1; i < CPLENSUPP; i++) {
CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP,0,&info);
- size_t len = lstrlen(info.CodePageName+7);
+ size_t len = mir_tstrlen(info.CodePageName+7);
info.CodePageName[len+6]=0;
SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_ADDSTRING,0,(LPARAM)(info.CodePageName+7));
}
@@ -745,7 +745,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))) {
DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- if (lstrlenA(DlgInput))
+ if (mir_strlen(DlgInput))
DlgEnableAccount(hDlg,TRUE,TRUE);
else
DlgEnableAccount(hDlg,FALSE,FALSE);
@@ -1262,7 +1262,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput)))
{
DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- if (lstrlenA(DlgInput))
+ if (mir_strlen(DlgInput))
DlgEnableAccountPopup(hDlg,TRUE,TRUE);
else
DlgEnableAccountPopup(hDlg,FALSE,FALSE);
@@ -1339,12 +1339,12 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
TesterF.lchIcon=g_LoadIconEx(3);
TesterN.lchIcon=g_LoadIconEx(1);
- lstrcpyn(Tester.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
- lstrcpyn(TesterF.lptzContactName,TranslateT("Account Test (failed)"),MAX_CONTACTNAME);
- lstrcpyn(TesterN.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
- lstrcpyn(Tester.lptzText,TranslateT("You have N new mail messages"),MAX_SECONDLINE);
- lstrcpyn(TesterF.lptzText,TranslateT("Connection failed message"),MAX_SECONDLINE);
- lstrcpyn(TesterN.lptzText,TranslateT("No new mail message"),MAX_SECONDLINE);
+ mir_tstrncpy(Tester.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
+ mir_tstrncpy(TesterF.lptzContactName,TranslateT("Account Test (failed)"),MAX_CONTACTNAME);
+ mir_tstrncpy(TesterN.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
+ mir_tstrncpy(Tester.lptzText,TranslateT("You have N new mail messages"),MAX_SECONDLINE);
+ mir_tstrncpy(TesterF.lptzText,TranslateT("Connection failed message"),MAX_SECONDLINE);
+ mir_tstrncpy(TesterN.lptzText,TranslateT("No new mail message"),MAX_SECONDLINE);
if (TesterC)
{
Tester.colorBack=SendDlgItemMessage(hDlg,IDC_CPB,CPM_GETCOLOUR,0,0);
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp
index 399424fd0f..cb158fdc9e 100644
--- a/plugins/YAMN/src/services.cpp
+++ b/plugins/YAMN/src/services.cpp
@@ -39,7 +39,7 @@ static INT_PTR Service_SetStatus(WPARAM wParam, LPARAM lParam)
static INT_PTR Service_GetName(WPARAM wParam, LPARAM lParam)
{
- lstrcpynA((char *) lParam, YAMN_DBMODULE, wParam);
+ mir_strncpy((char *) lParam, YAMN_DBMODULE, wParam);
return 0;
}
@@ -93,11 +93,11 @@ static INT_PTR ContactApplication(WPARAM wParam, LPARAM lParam)
Command = new WCHAR[wcslen(ActualAccount->NewMailN.App)+6];
if (Command != NULL) {
- lstrcpyW(Command, L"\"");
- lstrcatW(Command, ActualAccount->NewMailN.App);
- lstrcatW(Command, L"\" ");
+ mir_wstrcpy(Command, L"\"");
+ mir_wstrcat(Command, ActualAccount->NewMailN.App);
+ mir_wstrcat(Command, L"\" ");
if (ActualAccount->NewMailN.AppParam != NULL)
- lstrcatW(Command, ActualAccount->NewMailN.AppParam);
+ mir_wstrcat(Command, ActualAccount->NewMailN.AppParam);
PROCESS_INFORMATION pi;
CreateProcessW(NULL, Command, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp
index 247b688189..6555e8d0a0 100644
--- a/plugins/mTextControl/src/FormattedTextDraw.cpp
+++ b/plugins/mTextControl/src/FormattedTextDraw.cpp
@@ -67,7 +67,7 @@ HRESULT CFormattedTextDraw::putRTFTextA(char *newVal)
m_editCookie.isUnicode = false;
m_editCookie.ansi = newVal;
- m_editCookie.dwSize = lstrlenA(m_editCookie.ansi);
+ m_editCookie.dwSize = mir_strlen(m_editCookie.ansi);
m_editCookie.dwCount = 0;
editStream.dwCookie = (DWORD_PTR) &m_editCookie;
editStream.dwError = 0;
@@ -88,7 +88,7 @@ HRESULT CFormattedTextDraw::putRTFTextW(WCHAR *newVal)
m_editCookie.isUnicode = true;
m_editCookie.unicode = newVal;
- m_editCookie.dwSize = lstrlenW(m_editCookie.unicode);
+ m_editCookie.dwSize = mir_wstrlen(m_editCookie.unicode);
m_editCookie.dwCount = 0;
editStream.dwCookie = (DWORD_PTR) &m_editCookie;
editStream.dwError = 0;
@@ -109,7 +109,7 @@ HRESULT CFormattedTextDraw::putTextA(char *newVal)
m_editCookie.isUnicode = false;
m_editCookie.ansi = newVal;
- m_editCookie.dwSize = lstrlenA(m_editCookie.ansi);
+ m_editCookie.dwSize = mir_strlen(m_editCookie.ansi);
m_editCookie.dwCount = 0;
editStream.dwCookie = (DWORD_PTR) &m_editCookie;
editStream.dwError = 0;
@@ -138,7 +138,7 @@ HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal)
m_editCookie.isUnicode = true;
m_editCookie.unicode = newVal;
- m_editCookie.dwSize = lstrlenW(m_editCookie.unicode);
+ m_editCookie.dwSize = mir_wstrlen(m_editCookie.unicode);
m_editCookie.dwCount = 0;
editStream.dwCookie = (DWORD_PTR) &m_editCookie;
editStream.dwError = 0;
@@ -507,7 +507,7 @@ HRESULT CFormattedTextDraw::CharFormatFromHFONT(CHARFORMAT2W* pCF, HFONT hFont)
pCF->bPitchAndFamily = lf.lfPitchAndFamily;
- lstrcpyW(pCF->szFaceName, lf.lfFaceName);
+ mir_wstrcpy(pCF->szFaceName, lf.lfFaceName);
return S_OK;
diff --git a/plugins/mTextControl/src/textusers.cpp b/plugins/mTextControl/src/textusers.cpp
index 3f2c2f0f0f..96dad7d8c6 100644
--- a/plugins/mTextControl/src/textusers.cpp
+++ b/plugins/mTextControl/src/textusers.cpp
@@ -44,8 +44,8 @@ HANDLE DLL_CALLCONV
MTI_TextUserAdd(const char *userTitle, DWORD options)
{
TextUser *textUserNew = new TextUser;
- textUserNew->name = new char [lstrlenA(userTitle)+1];
- lstrcpyA(textUserNew->name, userTitle);
+ textUserNew->name = new char [mir_strlen(userTitle)+1];
+ mir_strcpy(textUserNew->name, userTitle);
textUserNew->options =
(db_get_dw(0, MODULNAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK);
db_set_dw(0, MODULNAME, userTitle, textUserNew->options);
diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp
index 29e286a969..9f9675f0c7 100644
--- a/protocols/EmLanProto/src/amdproto.cpp
+++ b/protocols/EmLanProto/src/amdproto.cpp
@@ -81,7 +81,7 @@ static INT_PTR __cdecl EMPGetCaps(WPARAM wParam,LPARAM )
static INT_PTR __cdecl EMPGetName(WPARAM wParam,LPARAM lParam)
{
- lstrcpyn((char*)lParam, "EmLan", wParam);
+ mir_tstrncpy((char*)lParam, "EmLan", wParam);
return 0;
}
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp
index 945a6a16b7..267c17dca3 100644
--- a/protocols/EmLanProto/src/mlan.cpp
+++ b/protocols/EmLanProto/src/mlan.cpp
@@ -437,10 +437,10 @@ void CMLan::RecvMessageUrl(CCSDATA* ccs)
dbei.szModule = PROTONAME;
dbei.timestamp = pre->timestamp;
dbei.flags = pre->flags&PREF_CREATEREAD?DBEF_READ:0;
- dbei.cbBlob = lstrlen(pre->szMessage)+1;
+ dbei.cbBlob = mir_tstrlen(pre->szMessage)+1;
if (!lstrcmpA(ccs->szProtoService, PSR_URL))
{
- dbei.cbBlob += 2+lstrlen(pre->szMessage+dbei.cbBlob+1);
+ dbei.cbBlob += 2+mir_tstrlen(pre->szMessage+dbei.cbBlob+1);
}
dbei.pBlob = (PBYTE)pre->szMessage;
@@ -475,7 +475,7 @@ int CMLan::SendMessageUrl(CCSDATA* ccs, bool isUrl)
int len;
if (isUrl)
{
- len = lstrlen((char*)ccs->lParam);
+ len = mir_tstrlen((char*)ccs->lParam);
((char*)ccs->lParam)[len] = 1;
}
TDataHolder* hold = new TDataHolder(ccs, cid, isUrl?LEXT_SENDURL:LEXT_SENDMESSAGE, this);
@@ -545,10 +545,10 @@ void CMLan::SearchExt(TDataHolder* hold)
if (strcmp(hold->msg, cont->m_nick)==0 || strcmp(hold->msg, "*")==0)
{
char buf[MAX_HOSTNAME_LEN];
- lstrcpy(buf, cont->m_nick);
- int len = lstrlen(buf);
+ mir_tstrcpy(buf, cont->m_nick);
+ int len = mir_tstrlen(buf);
buf[len] = '@';
- lstrcpy(buf+len+1, inet_ntoa(cont->m_addr));
+ mir_tstrcpy(buf+len+1, inet_ntoa(cont->m_addr));
psr.hdr.nick = cont->m_nick;
psr.hdr.firstName="";
psr.hdr.lastName="";
@@ -662,7 +662,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen)
int nameLen;
if (pak.strName)
{
- nameLen = lstrlen(pak.strName);
+ nameLen = mir_tstrlen(pak.strName);
len += 1+1+nameLen+1;
}
@@ -672,9 +672,9 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen)
int mesLen = 0;
if (pak.strMessage)
{
- mesLen = lstrlen(pak.strMessage);
+ mesLen = mir_tstrlen(pak.strMessage);
if (pak.flIsUrl)
- mesLen += 1+lstrlen(pak.strMessage+mesLen+1);
+ mesLen += 1+mir_tstrlen(pak.strMessage+mesLen+1);
len += 3+1+4+mesLen+1;
}
@@ -687,7 +687,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen)
int awayLen = 0;
if (pak.strAwayMessage)
{
- awayLen = lstrlen(pak.strAwayMessage);
+ awayLen = mir_tstrlen(pak.strAwayMessage);
len += 3+1+4+awayLen+1;
}
@@ -863,9 +863,9 @@ void CMLan::LoadSettings()
}
if (!dbv.pszVal[0])
dbv.pszVal = "EmLan_User";
- lstrcpy(m_name, dbv.pszVal);
+ mir_tstrcpy(m_name, dbv.pszVal);
}
- m_nameLen = lstrlen(m_name);
+ m_nameLen = mir_tstrlen(m_name);
if (GetStatus()!=LM_LISTEN)
{
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp
index 574d865cac..4f3e848c4b 100644
--- a/protocols/GTalkExt/src/avatar.cpp
+++ b/protocols/GTalkExt/src/avatar.cpp
@@ -39,7 +39,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile)
if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)SIZEOF(name), (LPARAM)&name))
return NULL;
- for (int i = lstrlen(name); i >= 0; i--)
+ for (int i = mir_tstrlen(name); i >= 0; i--)
if ('.' == name[i]) {
name[i] = 0;
break;
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index 8c3817474f..af6f5bc8f8 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -45,18 +45,18 @@ GoogleTalkAcc* isGoogle(LPARAM lParam)
void FormatMessageUrl(LPCTSTR format, LPTSTR buf, LPCTSTR mailbox, LPCTSTR tid)
{
ULARGE_INTEGER iTid; iTid.QuadPart = _tstoi64(tid);
- int l = lstrlen(buf);
+ int l = mir_tstrlen(buf);
mir_sntprintf(buf, l, format, mailbox, iTid.HighPart, iTid.LowPart);
- assert(l >= lstrlen(buf));
+ assert(l >= mir_tstrlen(buf));
}
void MakeUrlHex(LPTSTR url, LPCTSTR tid)
{
ULARGE_INTEGER iTid; iTid.QuadPart = _tstoi64(tid);
LPTSTR tidInUrl = _tcsstr(url, tid);
- LPTSTR trail = tidInUrl + lstrlen(tid);
+ LPTSTR trail = tidInUrl + mir_tstrlen(tid);
wsprintf(tidInUrl, _T("%x%08x"), iTid.HighPart, iTid.LowPart); //!!!!!!!!!!!!
- wmemmove(tidInUrl + lstrlen(tidInUrl), trail, lstrlen(trail) + 1);
+ wmemmove(tidInUrl + mir_tstrlen(tidInUrl), trail, mir_tstrlen(trail) + 1);
}
LPTSTR ExtractJid(LPCTSTR jidWithRes)
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp
index 51a0cf5ddd..6ac9790478 100644
--- a/protocols/GTalkExt/src/inbox.cpp
+++ b/protocols/GTalkExt/src/inbox.cpp
@@ -60,7 +60,7 @@ LPSTR HttpPost(HANDLE hUser, LPSTR reqUrl, LPSTR reqParams)
nlhr.headers = (NETLIBHTTPHEADER*)&HEADER_URL_ENCODED;
nlhr.headersCount = 1;
nlhr.pData = reqParams;
- nlhr.dataLength = lstrlenA(reqParams);
+ nlhr.dataLength = mir_strlen(reqParams);
NETLIBHTTPREQUEST *pResp = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hUser, (LPARAM)&nlhr);
if (!pResp) return NULL;
@@ -78,7 +78,7 @@ LPSTR HttpPost(HANDLE hUser, LPSTR reqUrl, LPSTR reqParams)
LPSTR MakeRequest(HANDLE hUser, LPSTR reqUrl, LPSTR reqParamsFormat, LPSTR p1, LPSTR p2)
{
ptrA encodedP1( mir_urlEncode(p1)), encodedP2( mir_urlEncode(p2));
- size_t size = lstrlenA(reqParamsFormat) + 1 + lstrlenA(encodedP1) + lstrlenA(encodedP2);
+ size_t size = mir_strlen(reqParamsFormat) + 1 + mir_strlen(encodedP1) + mir_strlen(encodedP2);
LPSTR reqParams = (LPSTR)alloca(size);
mir_snprintf(reqParams, size, reqParamsFormat, encodedP1, encodedP2);
return HttpPost(hUser, reqUrl, reqParams);
@@ -93,11 +93,11 @@ LPSTR FindSid(LPSTR resp, LPSTR *LSID)
if (SID - 1 == *LSID) SID = strstr(SID + 1, SID_KEY_NAME);
if (!SID) return NULL;
- SID += lstrlenA(SID_KEY_NAME);
+ SID += mir_strlen(SID_KEY_NAME);
LPSTR term = strstr(SID, "\n");
if (term) term[0] = 0;
- *LSID += lstrlenA(LSID_KEY_NAME);
+ *LSID += mir_strlen(LSID_KEY_NAME);
term = strstr(*LSID, "\n");
if (term) term[0] = 0;
@@ -107,7 +107,7 @@ LPSTR FindSid(LPSTR resp, LPSTR *LSID)
void DoOpenUrl(LPSTR tokenResp, LPSTR url)
{
ptrA encodedUrl( mir_urlEncode(url)), encodedToken( mir_urlEncode(tokenResp));
- size_t size = lstrlenA(TOKEN_AUTH_URL) + 1 + lstrlenA(encodedToken) + lstrlenA(encodedUrl);
+ size_t size = mir_strlen(TOKEN_AUTH_URL) + 1 + mir_strlen(encodedToken) + mir_strlen(encodedUrl);
LPSTR composedUrl = (LPSTR)alloca(size);
mir_snprintf(composedUrl, size, TOKEN_AUTH_URL, encodedToken, encodedUrl);
CallService(MS_UTILS_OPENURL, 0, (LPARAM)composedUrl);
@@ -177,8 +177,8 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url)
int pwdLen = GetMailboxPwd(acc, mailbox, NULL, 0);
if (!pwdLen++) return FALSE;
- int urlLen = lstrlen(url) + 1;
- int mailboxLen = lstrlen(mailbox) + 1;
+ int urlLen = mir_tstrlen(url) + 1;
+ int mailboxLen = mir_tstrlen(mailbox) + 1;
OPEN_URL_HEADER *data = (OPEN_URL_HEADER*)malloc(sizeof(OPEN_URL_HEADER) + urlLen + mailboxLen + pwdLen);
data->url = (LPSTR)data + sizeof(OPEN_URL_HEADER);
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index 20825d8d8f..5acef31604 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -177,7 +177,7 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST
// SetAvatar(hContact);
if (displayName == NULL) {
- TCHAR *tszTemp = (TCHAR*)alloca((lstrlen(jid) + lstrlen(unreadCount) + 3 + 1) * sizeof(TCHAR));
+ TCHAR *tszTemp = (TCHAR*)alloca((mir_tstrlen(jid) + mir_tstrlen(unreadCount) + 3 + 1) * sizeof(TCHAR));
FormatPseudocontactDisplayName(tszTemp, jid, unreadCount);
db_set_ts(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, tszTemp);
}
@@ -231,8 +231,8 @@ void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LP
}
data->PluginWindowProc = PopupProc;
- int lurl = (lstrlen(url) + 1) * sizeof(TCHAR);
- int ljid = (lstrlen(jid) + 1) * sizeof(TCHAR);
+ int lurl = (mir_tstrlen(url) + 1) * sizeof(TCHAR);
+ int ljid = (mir_tstrlen(jid) + 1) * sizeof(TCHAR);
POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)malloc(sizeof(POPUP_DATA_HEADER) + lurl + ljid);
ppdh->MarkRead = FALSE;
@@ -272,7 +272,7 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre
mir_sntprintf(currSender, SENDER_COUNT * 100, _T(" %s <%s>\n"), mtn->senders[i].name, mtn->senders[i].addr);
else
mir_sntprintf(currSender, SENDER_COUNT * 100, _T(" %s\n"), mtn->senders[i].addr);
- currSender += lstrlen(currSender);
+ currSender += mir_tstrlen(currSender);
}
if ( ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings)))
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index b0226022a6..8537427ddb 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -128,7 +128,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
break;
default:
ptstr = str;
- lstrcpy(str, _T("???"));
+ mir_tstrcpy(str, _T("???"));
break;
}
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 6d0a6899f6..60d588e888 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -1025,7 +1025,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
// Add missing file extension
const TCHAR *szImgType = gg_img_guessfileextension(dat->lpData);
if (*szImgType) {
- dat->lpszFileName = (TCHAR*)calloc(sizeof(TCHAR), lstrlen(tmpFileName) + lstrlen(szImgType) + 1);
+ dat->lpszFileName = (TCHAR*)calloc(sizeof(TCHAR), mir_tstrlen(tmpFileName) + mir_tstrlen(szImgType) + 1);
if (dat->lpszFileName != NULL) {
_tcscpy(dat->lpszFileName, tmpFileName);
_tcscat(dat->lpszFileName, szImgType);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 1fd3c49070..693c8f6b70 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -142,7 +142,7 @@ static BOOL IsOverAction(HWND hwndDlg)
szText[0] = 0;
ListView_GetItemText(hList, hti.iItem, hti.iSubItem, szText, SIZEOF(szText));
hdc = GetDC(hList);
- GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textSize);
+ GetTextExtentPoint32(hdc, szText, mir_tstrlen(szText), &textSize);
ReleaseDC(hList, hdc);
textPosX = rc.left + (((rc.right - rc.left) - textSize.cx) / 2);
return (hti.pt.x > textPosX && hti.pt.x < textPosX + textSize.cx);
@@ -250,9 +250,9 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
GetClientRect(hwndHeader, &rcHeader);
rc.top += rcHeader.bottom;
}
- GetTextExtentPoint32(nm->nmcd.hdc, szText, lstrlen(szText), &textSize);
+ GetTextExtentPoint32(nm->nmcd.hdc, szText, mir_tstrlen(szText), &textSize);
textPosX = rc.left + (((rc.right - rc.left) - textSize.cx) / 2);
- ExtTextOut(nm->nmcd.hdc, textPosX, rc.top + textSize.cy, ETO_OPAQUE, &rc, szText, lstrlen(szText), NULL);
+ ExtTextOut(nm->nmcd.hdc, textPosX, rc.top + textSize.cy, ETO_OPAQUE, &rc, szText, mir_tstrlen(szText), NULL);
}
// FALL THROUGH
@@ -332,9 +332,9 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, SIZEOF(szIP));
ListView_GetItemText(hList, lvhti.iItem, 2, szLoginTime, SIZEOF(szLoginTime));
mir_sntprintf(szText, SIZEOF(szText), _T("%s\t%s\t%s"), szClientName, szIP, szLoginTime);
- if ((hData = GlobalAlloc(GMEM_MOVEABLE, lstrlen(szText) + 1)) != NULL)
+ if ((hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(szText) + 1)) != NULL)
{
- lstrcpy((TCHAR*)GlobalLock(hData), szText);
+ mir_tstrcpy((TCHAR*)GlobalLock(hData), szText);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
}
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 8f39d5aefe..5bc6b89aa5 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -53,7 +53,7 @@ VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (ppro->m_forceVisible)
ppro->PostIrcMessage(_T("/MODE %s -i"), ppro->m_info.sNick.c_str());
- if (lstrlenA(ppro->m_myHost) == 0 && ppro->IsConnected())
+ if (mir_strlen(ppro->m_myHost) == 0 && ppro->IsConnected())
ppro->DoUserhostWithReason(2, (_T("S") + ppro->m_info.sNick).c_str(), true, _T("%s"), ppro->m_info.sNick.c_str());
}
@@ -240,7 +240,7 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di)
{
mir_cslock lock(m_resolve);
- if (ipr != NULL && (ipr->iType == IP_AUTO && lstrlenA(m_myHost) == 0 || ipr->iType == IP_MANUAL)) {
+ if (ipr != NULL && (ipr->iType == IP_AUTO && mir_strlen(m_myHost) == 0 || ipr->iType == IP_MANUAL)) {
hostent* myhost = gethostbyname(ipr->sAddr.c_str());
if (myhost) {
IN_ADDR in;
@@ -275,7 +275,7 @@ bool CIrcProto::OnIrc_WELCOME(const CIrcMessage* pmsg)
CMString word = GetWord(pmsg->parameters[1].c_str(), i);
while (!word.IsEmpty()) {
if (_tcschr(word.c_str(), '!') && _tcschr(word.c_str(), '@')) {
- lstrcpyn(host, word.c_str(), SIZEOF(host));
+ mir_tstrncpy(host, word.c_str(), SIZEOF(host));
TCHAR* p1 = _tcschr(host, '@');
if (p1)
ForkThread(&CIrcProto::ResolveIPThread, new IPRESOLVE(_T2A(p1 + 1), IP_AUTO));
@@ -717,7 +717,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
if (bIsChannel) {
if (!(pmsg->m_bIncoming && m_ignore && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'm'))) {
if (!pmsg->m_bIncoming)
- ReplaceString(mess, _T("%%"), _T("%"));
+ mess.Replace(_T("%%"), _T("%"));
DoEvent(GC_EVENT_MESSAGE, pmsg->parameters[0].c_str(), pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
}
return true;
@@ -781,7 +781,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
if (mess.GetLength() > 1) {
mess.Delete(0, 1);
if (!pmsg->m_bIncoming)
- ReplaceString(mess, _T("%%"), _T("%"));
+ mess.Replace(_T("%%"), _T("%"));
DoEvent(GC_EVENT_ACTION, pmsg->parameters[0].c_str(), pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
}
@@ -844,7 +844,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else if (pmsg->m_bIncoming && command == _T("time")) {
TCHAR temp[300];
time_t tim = time(NULL);
- lstrcpyn(temp, _tctime(&tim), 25);
+ mir_tstrncpy(temp, _tctime(&tim), 25);
PostIrcMessage(_T("/NOTICE %s \001TIME %s\001"), pmsg->prefix.sNick.c_str(), temp);
mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
@@ -1518,7 +1518,7 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
TCHAR* save = temp;
if (find == temp && find2 != NULL && find + 8 >= find2) {
temp = _tcsstr(temp, _T("]"));
- if (lstrlen(temp) > 1) {
+ if (mir_tstrlen(temp) > 1) {
temp++;
temp[0] = '\0';
lvItem.iSubItem = 2;
@@ -1568,8 +1568,8 @@ bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg)
if (m_noOfChannels > 0)
percent = (int)(m_channelNumber * 100) / m_noOfChannels;
if (percent < 70) {
- lstrcat(text, _T(" "));
- lstrcat(text, TranslateT("(probably truncated by server)"));
+ mir_tstrcat(text, _T(" "));
+ mir_tstrcat(text, TranslateT("(probably truncated by server)"));
}
SetDlgItemText(m_listDlg->GetHwnd(), IDC_TEXT, text);
}
@@ -1593,7 +1593,7 @@ bool CIrcProto::OnIrc_BANLIST(const CIrcMessage* pmsg)
S += _T(" - ( ");
time_t time = StrToInt(pmsg->parameters[4].c_str());
S += _tctime(&time);
- ReplaceString(S, _T("\n"), _T(" "));
+ S.Replace(_T("\n"), _T(" "));
S += _T(")");
}
}
@@ -1676,7 +1676,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
TCHAR temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
- lstrcat(temp, _T("%s\r\n"));
+ mir_tstrcat(temp, _T("%s\r\n"));
mir_sntprintf(temp2, 1020, temp, pmsg->parameters[2].c_str());
m_whoisDlg->m_InfoOther.SetText(temp2);
}
@@ -2016,7 +2016,7 @@ bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
m_whoReply.AppendFormat(_T("%s %s %s %s "), pmsg->parameters[5].c_str(), pmsg->parameters[2].c_str(), pmsg->parameters[3].c_str(), pmsg->parameters[6].c_str());
if (lstrcmpi(pmsg->parameters[5].c_str(), m_info.sNick.c_str()) == 0) {
TCHAR host[1024];
- lstrcpyn(host, pmsg->parameters[3].c_str(), 1024);
+ mir_tstrncpy(host, pmsg->parameters[3].c_str(), 1024);
ForkThread(&CIrcProto::ResolveIPThread, new IPRESOLVE(_T2A(host), IP_AUTO));
}
}
@@ -2187,8 +2187,8 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
TCHAR szAltPort[20];
if (pmsg->parameters.getCount() > 1 && _stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szAltServer, &szAltPort) == 2) {
ShowMessage(pmsg);
- lstrcpynA(m_serverName, _T2A(szAltServer), 99);
- lstrcpynA(m_portStart, _T2A(szAltPort), 9);
+ mir_strncpy(m_serverName, _T2A(szAltServer), 99);
+ mir_strncpy(m_portStart, _T2A(szAltPort), 9);
m_noOfChannels = 0;
ConnectToServer();
@@ -2205,13 +2205,13 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
if (_tcsstr(temp, _T("CHANTYPES="))) {
TCHAR* p1 = _tcschr(temp, '=');
p1++;
- if (lstrlen(p1) > 0)
+ if (mir_tstrlen(p1) > 0)
sChannelPrefixes = p1;
}
if (_tcsstr(temp, _T("CHANMODES="))) {
TCHAR* p1 = _tcschr(temp, '=');
p1++;
- if (lstrlen(p1) > 0)
+ if (mir_tstrlen(p1) > 0)
sChannelModes = (char*)_T2A(p1);
}
if (_tcsstr(temp, _T("PREFIX="))) {
@@ -2390,7 +2390,7 @@ static void __cdecl AwayWarningThread(LPVOID)
int CIrcProto::DoPerform(const char* event)
{
- String sSetting = String("PERFORM:") + event;
+ CMStringA sSetting = CMStringA("PERFORM:") + event;
sSetting.MakeUpper();
DBVARIANT dbv;
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp
index 29d5b4c14b..019ac57cb2 100644
--- a/protocols/IRCG/src/input.cpp
+++ b/protocols/IRCG/src/input.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void CIrcProto::FormatMsg(CMString& text)
{
TCHAR temp[30];
- lstrcpyn(temp, GetWord(text.c_str(), 0).c_str(), 29);
+ mir_tstrncpy(temp, GetWord(text.c_str(), 0).c_str(), 29);
CharLower(temp);
CMString command = temp;
CMString S = _T("");
@@ -56,7 +56,7 @@ void CIrcProto::FormatMsg(CMString& text)
}
}
- ReplaceString(sNewNick, NICKSUBSTITUTE, sNick4Perform.c_str());
+ sNewNick.Replace(NICKSUBSTITUTE, sNick4Perform.c_str());
S = GetWord(text.c_str(), 0) + _T(" ") + sNewNick;
}
}
@@ -68,8 +68,8 @@ void CIrcProto::FormatMsg(CMString& text)
static void AddCR(CMString& text)
{
- ReplaceString(text, _T("\n"), _T("\r\n"));
- ReplaceString(text, _T("\r\r"), _T("\r"));
+ text.Replace(_T("\n"), _T("\r\n"));
+ text.Replace(_T("\r\r"), _T("\r"));
}
CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
@@ -89,16 +89,16 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
Messageout += _T("\r\n");
TCHAR* line = new TCHAR[p2 - p1 + 1];
- lstrcpyn(line, p1, p2 - p1 + 1);
+ mir_tstrncpy(line, p1, p2 - p1 + 1);
TCHAR* test = line;
while (*test == ' ')
test++;
if (*test == '/') {
- lstrcpyn(line, GetWordAddress(line, 0), p2 - p1 + 1);
+ mir_tstrncpy(line, GetWordAddress(line, 0), p2 - p1 + 1);
CMString S = line;
delete[] line;
line = new TCHAR[S.GetLength() + 2];
- lstrcpyn(line, S.c_str(), S.GetLength() + 1);
+ mir_tstrncpy(line, S.c_str(), S.GetLength() + 1);
CMString alias(m_alias);
const TCHAR* p3 = _tcsstr(alias.c_str(), (GetWord(line, 0) + _T(" ")).c_str());
if (p3 != alias.c_str()) {
@@ -116,29 +116,29 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
*(TCHAR*)p4 = 0;
CMString S = p3;
- ReplaceString(S, _T("##"), window);
- ReplaceString(S, _T("$?"), _T("%question"));
+ S.Replace(_T("##"), window);
+ S.Replace(_T("$?"), _T("%question"));
for (int index = 1; index < 8; index++) {
TCHAR str[5];
mir_sntprintf(str, SIZEOF(str), _T("#$%u"), index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
- ReplaceString(S, str, GetWord(line, index).c_str());
+ S.Replace(str, GetWord(line, index).c_str());
else {
CMString S1 = _T("#");
S1 += GetWord(line, index);
- ReplaceString(S, str, S1.c_str());
+ S.Replace(str, S1.c_str());
}
}
for (int index2 = 1; index2 < 8; index2++) {
TCHAR str[5];
mir_sntprintf(str, SIZEOF(str), _T("$%u-"), index2);
- ReplaceString(S, str, GetWordAddress(line, index2));
+ S.Replace(str, GetWordAddress(line, index2));
}
for (int index3 = 1; index3 < 8; index3++) {
TCHAR str[5];
mir_sntprintf(str, SIZEOF(str), _T("$%u"), index3);
- ReplaceString(S, str, GetWord(line, index3).c_str());
+ S.Replace(str, GetWord(line, index3).c_str());
}
Messageout += GetWordAddress(S.c_str(), 1);
}
@@ -166,32 +166,32 @@ CMString CIrcProto::DoIdentifiers(CMString text, const TCHAR*)
TCHAR str[2];
GetLocalTime(&time);
- ReplaceString(text, _T("%mnick"), m_nick);
- ReplaceString(text, _T("%anick"), m_alternativeNick);
- ReplaceString(text, _T("%awaymsg"), m_statusMessage.c_str());
- ReplaceString(text, _T("%module"), _A2T(m_szModuleName));
- ReplaceString(text, _T("%name"), m_name);
- ReplaceString(text, _T("%newl"), _T("\r\n"));
- ReplaceString(text, _T("%network"), m_info.sNetwork.c_str());
- ReplaceString(text, _T("%me"), m_info.sNick.c_str());
+ text.Replace(_T("%mnick"), m_nick);
+ text.Replace(_T("%anick"), m_alternativeNick);
+ text.Replace(_T("%awaymsg"), m_statusMessage.c_str());
+ text.Replace(_T("%module"), _A2T(m_szModuleName));
+ text.Replace(_T("%name"), m_name);
+ text.Replace(_T("%newl"), _T("\r\n"));
+ text.Replace(_T("%network"), m_info.sNetwork.c_str());
+ text.Replace(_T("%me"), m_info.sNick.c_str());
char mirver[100];
CallService(MS_SYSTEM_GETVERSIONTEXT, SIZEOF(mirver), LPARAM(mirver));
- ReplaceString(text, _T("%mirver"), _A2T(mirver));
+ text.Replace(_T("%mirver"), _A2T(mirver));
- ReplaceString(text, _T("%version"), _T(__VERSION_STRING_DOTS));
+ text.Replace(_T("%version"), _T(__VERSION_STRING_DOTS));
str[0] = 3; str[1] = '\0';
- ReplaceString(text, _T("%color"), str);
+ text.Replace(_T("%color"), str);
str[0] = 2;
- ReplaceString(text, _T("%bold"), str);
+ text.Replace(_T("%bold"), str);
str[0] = 31;
- ReplaceString(text, _T("%underline"), str);
+ text.Replace(_T("%underline"), str);
str[0] = 22;
- ReplaceString(text, _T("%italics"), str);
+ text.Replace(_T("%italics"), str);
return text;
}
@@ -215,7 +215,7 @@ static void __stdcall sttSetTimerOff(void* _pro)
BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hContact)
{
TCHAR temp[30];
- lstrcpyn(temp, GetWord(text.c_str(), 0).c_str(), 29);
+ mir_tstrncpy(temp, GetWord(text.c_str(), 0).c_str(), 29);
CharLower(temp);
CMString command = temp;
CMString one = GetWord(text.c_str(), 1);
@@ -524,7 +524,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta
return true;
CMString S = _T("/ME ") + DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
- ReplaceString(S, _T("%"), _T("%%"));
+ S.Replace(_T("%"), _T("%%"));
DoEvent(GC_EVENT_SENDMESSAGE, NULL, NULL, S.c_str(), NULL, NULL, NULL, FALSE, FALSE);
return true;
}
@@ -534,7 +534,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta
return true;
CMString S = DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
- ReplaceString(S, _T("%"), _T("%%"));
+ S.Replace(_T("%"), _T("%%"));
DoEvent(GC_EVENT_SENDMESSAGE, NULL, NULL, S.c_str(), NULL, NULL, NULL, FALSE, FALSE);
return true;
}
@@ -793,7 +793,7 @@ static void __stdcall DoInputRequestAliasApcStub(void* _par)
bool CIrcProto::PostIrcMessage(const TCHAR* fmt, ...)
{
- if (!fmt || lstrlen(fmt) < 1 || lstrlen(fmt) > 4000)
+ if (!fmt || mir_tstrlen(fmt) < 1 || mir_tstrlen(fmt) > 4000)
return 0;
va_list marker;
@@ -814,17 +814,17 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR* window, MCONTACT hContact, const TCHAR*
if (hContact)
bDCC = getByte(hContact, "DCC", 0);
- if (!IsConnected() && !bDCC || !szBuf || lstrlen(szBuf) < 1)
+ if (!IsConnected() && !bDCC || !szBuf || mir_tstrlen(szBuf) < 1)
return 0;
if (hContact && !getTString(hContact, "Nick", &dbv)) {
- lstrcpyn(windowname, dbv.ptszVal, 255);
+ mir_tstrncpy(windowname, dbv.ptszVal, 255);
db_free(&dbv);
}
else if (window)
- lstrcpyn(windowname, window, 255);
+ mir_tstrncpy(windowname, window, 255);
else
- lstrcpyn(windowname, SERVERWINDOW, 255);
+ mir_tstrncpy(windowname, SERVERWINDOW, 255);
if (lstrcmpi(window, SERVERWINDOW) != 0) {
TCHAR* p1 = _tcschr(windowname, ' ');
@@ -844,7 +844,7 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR* window, MCONTACT hContact, const TCHAR*
return 1;
}
- ReplaceString(Message, _T("%newl"), _T("\r\n"));
+ Message.Replace(_T("%newl"), _T("\r\n"));
RemoveLinebreaks(Message);
}
diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h
index b74ff0b710..68df80a0d8 100644
--- a/protocols/IRCG/src/irc.h
+++ b/protocols/IRCG/src/irc.h
@@ -98,7 +98,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define FILERESUME_CANCEL 11
struct CIrcProto;
-typedef CMStringA String;
// special service for tweaking performance, implemented in chat.dll
#define MS_GC_GETEVENTPTR "GChat/GetNewEventPtr"
@@ -121,7 +120,7 @@ struct IPRESOLVE // Contains info about the channels
~IPRESOLVE()
{}
- String sAddr;
+ CMStringA sAddr;
int iType;
};
@@ -158,7 +157,7 @@ struct PERFORM_INFO // Contains 'm_perform buffer' for different networks
~PERFORM_INFO()
{}
- String mSetting;
+ CMStringA mSetting;
CMString mText;
};
@@ -379,7 +378,7 @@ struct CIrcProto : public PROTO<CIrcProto>
CIgnorePrefsDlg* m_ignoreDlg;
int m_noOfChannels, m_manualWhoisCount;
- String sChannelModes, sUserModes;
+ CMStringA sChannelModes, sUserModes;
CMString sChannelPrefixes, sUserModePrefixes, WhoisAwayReply;
CDlgBase::CreateParam OptCreateAccount, OptCreateConn, OptCreateIgnore, OptCreateOther;
@@ -652,14 +651,12 @@ void ReleaseIconEx(HICON hIcon);
int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string);
char* __stdcall IrcLoadFile(TCHAR * szPath);
CMString __stdcall GetWord(const TCHAR* text, int index);
-CMString& __stdcall ReplaceString (CMString& text, const TCHAR* replaceme, const TCHAR* newword);
const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index);
void __stdcall RemoveLinebreaks( CMString& Message );
TCHAR* __stdcall my_strstri(const TCHAR *s1, const TCHAR *s2) ;
TCHAR* __stdcall DoColorCodes (const TCHAR* text, bool bStrip, bool bReplacePercent);
-String& __stdcall ReplaceString (String& text, const char* replaceme, const char* newword);
-String __stdcall GetWord(const char* text, int index);
+CMStringA __stdcall GetWord(const char* text, int index);
#pragma comment(lib,"comctl32.lib")
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index cae41d4668..9cea32cdf6 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -279,7 +279,7 @@ int CIrcProto::NLSend(const unsigned char* buf, int cbBuf)
if (!con || !buf)
return 0;
if (m_scriptingEnabled && cbBuf == 0)
- cbBuf = lstrlenA((const char *)buf);
+ cbBuf = mir_strlen((const char *)buf);
return Netlib_Send(con, (const char*)buf, cbBuf, MSG_DUMPASTEXT);
}
@@ -702,7 +702,7 @@ unsigned long ConvertIPToInteger(char* IP)
IN_ADDR in;
IN_ADDR intemp;
- if (IP == 0 || lstrlenA(IP) == 0)
+ if (IP == 0 || mir_strlen(IP) == 0)
return 0;
intemp.S_un.S_addr = inet_addr(IP);
@@ -815,7 +815,7 @@ int CDccSession::NLReceive(const unsigned char* buf, int cbBuf)
int CDccSession::SendStuff(const TCHAR* fmt)
{
- String buf = _T2A(fmt, m_proto->getCodepage());
+ CMStringA buf = _T2A(fmt, m_proto->getCodepage());
return NLSend((const unsigned char*)buf.c_str(), buf.GetLength());
}
diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h
index 4fc6c9bff5..043a83ca76 100644
--- a/protocols/IRCG/src/irclib.h
+++ b/protocols/IRCG/src/irclib.h
@@ -86,12 +86,12 @@ private :
struct CIrcSessionInfo
{
- String sServer;
+ CMStringA sServer;
CMString sServerName;
CMString sNick;
CMString sUserID;
CMString sFullName;
- String sPassword;
+ CMStringA sPassword;
CMString sIdentServerType;
CMString sNetwork;
bool bIdentServer;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 2cb0fda304..dfacc49281 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -166,11 +166,11 @@ static COLORREF crCols[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
static int sttCheckPerform(const char *szSetting, LPARAM lParam)
{
if (!_strnicmp(szSetting, "PERFORM:", 8)) {
- String s = szSetting;
+ CMStringA s = szSetting;
s.MakeUpper();
if (s != szSetting) {
- OBJLIST<String>* p = (OBJLIST<String>*)lParam;
- p->insert(new String(szSetting));
+ OBJLIST<CMStringA>* p = (OBJLIST<CMStringA>*)lParam;
+ p->insert(new CMStringA(szSetting));
}
}
return 0;
@@ -232,12 +232,12 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
while ((p1 = strstr(p2, "NETWORK: ")) != NULL) {
p1 += 9;
p2 = strchr(p1, '\n');
- String sNetwork(p1, int(p2 - p1 - 1));
+ CMStringA sNetwork(p1, int(p2 - p1 - 1));
sNetwork.MakeUpper();
p1 = p2;
p2 = strstr(++p1, "\nNETWORK: ");
if (!p2)
- p2 = p1 + lstrlenA(p1) - 1;
+ p2 = p1 + mir_strlen(p1) - 1;
if (p1 == p2)
break;
@@ -250,7 +250,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
mir_free(szLoadFileName);
if (!getByte("PerformConversionDone", 0)) {
- OBJLIST<String> performToConvert(10);
+ OBJLIST<CMStringA> performToConvert(10);
DBCONTACTENUMSETTINGS dbces = { 0 };
dbces.pfnEnumProc = sttCheckPerform;
dbces.lParam = (LPARAM)&performToConvert;
@@ -258,7 +258,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
CallService(MS_DB_CONTACT_ENUMSETTINGS, NULL, (LPARAM)&dbces);
for (int i = 0; i < performToConvert.getCount(); i++) {
- String s = performToConvert[i];
+ CMStringA s = performToConvert[i];
DBVARIANT dbv;
if (!getTString(s, &dbv)) {
db_unset(NULL, m_szModuleName, s);
@@ -278,16 +278,16 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
if (m_nick[0]) {
TCHAR szBuf[40];
- if (lstrlen(m_alternativeNick) == 0) {
+ if (mir_tstrlen(m_alternativeNick) == 0) {
mir_sntprintf(szBuf, SIZEOF(szBuf), _T("%s%u"), m_nick, rand() % 9999);
setTString("AlernativeNick", szBuf);
- lstrcpyn(m_alternativeNick, szBuf, 30);
+ mir_tstrncpy(m_alternativeNick, szBuf, 30);
}
- if (lstrlen(m_name) == 0) {
+ if (mir_tstrlen(m_name) == 0) {
mir_sntprintf(szBuf, SIZEOF(szBuf), _T("Miranda%u"), rand() % 9999);
setTString("Name", szBuf);
- lstrcpyn(m_name, szBuf, 200);
+ mir_tstrncpy(m_name, szBuf, 200);
}
}
@@ -532,7 +532,7 @@ HANDLE __cdecl CIrcProto::SearchBasic(const PROTOCHAR* szId)
if (m_iStatus != ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_CONNECTING &&
szId && szId[0] && !IsChannel(szId)) {
AckBasicSearchParam* param = new AckBasicSearchParam;
- lstrcpyn(param->buf, szId, 50);
+ mir_tstrncpy(param->buf, szId, 50);
ForkThread(&CIrcProto::AckBasicSearch, param);
return (HANDLE)1;
}
@@ -685,7 +685,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
// need to make sure that %'s are doubled to avoid having chat interpret as color codes
CMString sFileCorrect = dci->sFile;
- ReplaceString(sFileCorrect, _T("%"), _T("%%"));
+ sFileCorrect.Replace(_T("%"), _T("%%"));
// is it an reverse filetransfer (receiver acts as server)
if (dci->bReverse) {
@@ -948,7 +948,7 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const TCHAR* msg)
default:
CMString newStatus = msg;
- ReplaceString(newStatus, _T("\r\n"), _T(" "));
+ newStatus.Replace(_T("\r\n"), _T(" "));
if (m_statusMessage.IsEmpty() || msg == NULL || m_statusMessage != newStatus) {
if (msg == NULL || *msg == 0)
m_statusMessage = STR_AWAYMESSAGE;
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index ba57584a83..83e83cd725 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -76,7 +76,7 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count)
if (p->defStr == NULL)
*ptr = 0;
else
- lstrcpyn((TCHAR*)ptr, p->defStr, (int)p->size);
+ mir_tstrncpy((TCHAR*)ptr, p->defStr, (int)p->size);
}
else *(TCHAR**)ptr = mir_tstrdup(p->defStr);
}
@@ -133,14 +133,14 @@ static int sttServerEnum( const char* szSetting, LPARAM )
}
char* p2 = strchr(p1, ':');
pData->m_address = (char*)mir_alloc(p2 - p1 + 1);
- lstrcpynA(pData->m_address, p1, p2 - p1 + 1);
+ mir_strncpy(pData->m_address, p1, p2 - p1 + 1);
p1 = p2 + 1;
while (*p2 != 'G' && *p2 != '-')
p2++;
char* buf = (char*)alloca(p2 - p1 + 1);
- lstrcpynA(buf, p1, p2 - p1 + 1);
+ mir_strncpy(buf, p1, p2 - p1 + 1);
pData->m_portStart = atoi(buf);
if (*p2 == 'G')
@@ -149,14 +149,14 @@ static int sttServerEnum( const char* szSetting, LPARAM )
p1 = p2 + 1;
p2 = strchr(p1, 'G');
buf = (char*)alloca(p2 - p1 + 1);
- lstrcpynA(buf, p1, p2 - p1 + 1);
+ mir_strncpy(buf, p1, p2 - p1 + 1);
pData->m_portEnd = atoi(buf);
}
p1 = strchr(p2, ':') + 1;
p2 = strchr(p1, '\0');
pData->m_group = (char*)mir_alloc(p2 - p1 + 1);
- lstrcpynA(pData->m_group, p1, p2 - p1 + 1);
+ mir_strncpy(pData->m_group, p1, p2 - p1 + 1);
g_servers.insert(pData);
db_free(&dbv);
@@ -179,7 +179,7 @@ static void removeSpaces(TCHAR* p)
{
while (*p) {
if (*p == ' ')
- memmove(p, p + 1, sizeof(TCHAR)*lstrlen(p));
+ memmove(p, p + 1, sizeof(TCHAR)*mir_tstrlen(p));
p++;
}
}
@@ -762,9 +762,9 @@ void CConnectPrefsDlg::OnApply()
SERVER_INFO *pData = (SERVER_INFO*)m_serverCombo.GetItemData(i);
if (pData && (INT_PTR)pData != CB_ERR) {
if (m_enableServer.GetState())
- lstrcpyA(m_proto->m_network, pData->m_group);
+ mir_strcpy(m_proto->m_network, pData->m_group);
else
- lstrcpyA(m_proto->m_network, "");
+ mir_strcpy(m_proto->m_network, "");
m_proto->m_iSSL = pData->m_iSSL;
}
@@ -927,8 +927,8 @@ void CCtcpPrefsDlg::OnApply()
if (m_enableIP.GetState()) {
char szTemp[500];
m_ip.GetTextA(szTemp, sizeof(szTemp));
- lstrcpynA(m_proto->m_mySpecifiedHost, GetWord(szTemp, 0).c_str(), 499);
- if (lstrlenA(m_proto->m_mySpecifiedHost))
+ mir_strncpy(m_proto->m_mySpecifiedHost, GetWord(szTemp, 0).c_str(), 499);
+ if (mir_strlen(m_proto->m_mySpecifiedHost))
m_proto->ForkThread(&CIrcProto::ResolveIPThread, new IPRESOLVE(m_proto->m_mySpecifiedHost, IP_MANUAL));
}
else m_proto->m_mySpecifiedHost[0] = 0;
@@ -1193,7 +1193,7 @@ void COtherPrefsDlg::OnApply()
void COtherPrefsDlg::addPerformComboValue(int idx, const char* szValueName)
{
- String sSetting = String("PERFORM:") + szValueName;
+ CMStringA sSetting = CMStringA("PERFORM:") + szValueName;
sSetting.MakeUpper();
PERFORM_INFO* pPref;
@@ -1357,9 +1357,9 @@ void CIrcProto::InitIgnore(void)
pTemp--;
*++pTemp = 0;
- String mask = GetWord(p1, 0);
- String flags = GetWord(p1, 1);
- String network = GetWord(p1, 2);
+ CMStringA mask = GetWord(p1, 0);
+ CMStringA flags = GetWord(p1, 1);
+ CMStringA network = GetWord(p1, 2);
if (!mask.IsEmpty())
m_ignoreItems.insert(new CIrcIgnoreItem(getCodepage(), mask.c_str(), flags.c_str(), network.c_str()));
@@ -1892,7 +1892,7 @@ void InitServers()
if (serverFile) {
char* pszSvrs = (char*)LockResource(LoadResource(hInst, FindResource(hInst, MAKEINTRESOURCE(IDR_SERVERS), _T("TEXT"))));
if (pszSvrs)
- fwrite(pszSvrs, 1, lstrlenA(pszSvrs) + 1, serverFile);
+ fwrite(pszSvrs, 1, mir_strlen(pszSvrs) + 1, serverFile);
fclose(serverFile);
sttImportIni(szIniFile);
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp
index c67d884aaf..69a3c69335 100644
--- a/protocols/IRCG/src/output.cpp
+++ b/protocols/IRCG/src/output.cpp
@@ -134,7 +134,7 @@ BOOL CIrcProto::ShowMessage(const CIrcMessage* pmsg)
CMString mess = FormatOutput(pmsg);
if (!pmsg->m_bIncoming)
- ReplaceString(mess, _T("%%"), _T("%"));
+ mess.Replace(_T("%%"), _T("%"));
int iTemp = StrToInt(pmsg->sCommand.c_str());
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index 484a2b6739..3f2b63b4a6 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -39,9 +39,9 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertRawOut( WPARAM, LPARAM lParam )
{
char* pszRaw = (char*)lParam;
if (m_scriptingEnabled && pszRaw && IsConnected()) {
- String S = pszRaw;
- ReplaceString(S, "%", "%%%%");
- NLSendNoScript((const unsigned char *)S.c_str(), lstrlenA(S.c_str()));
+ CMStringA S = pszRaw;
+ S.Replace("%", "%%%%");
+ NLSendNoScript((const unsigned char *)S.c_str(), (int)mir_strlen(S.c_str()));
return 0;
}
@@ -110,7 +110,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam)
INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
{
if (m_scriptingEnabled && lparam) {
- String sString = (char*)lparam, sRequest;
+ CMStringA sString = (char*)lparam, sRequest;
CMString sOutput, sChannel;
int i = sString.Find("|");
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 7579f1775e..b7a9f14381 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -328,7 +328,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM)
host = dbv1.pszVal;
if (host) {
- String S;
+ CMStringA S;
if (m_ignoreChannelDefault)
S = "+qnidcm";
else
@@ -421,47 +421,47 @@ static void DoChatFormatting(TCHAR* pszText)
switch (p1[1]) {
case 'B':
case 'b':
- lstrcpy(InsertThis, _T("\002"));
+ mir_tstrcpy(InsertThis, _T("\002"));
iRemoveChars = 2;
break;
case 'I':
case 'i':
- lstrcpy(InsertThis, _T("\026"));
+ mir_tstrcpy(InsertThis, _T("\026"));
iRemoveChars = 2;
break;
case 'U':
case 'u':
- lstrcpy(InsertThis, _T("\037"));
+ mir_tstrcpy(InsertThis, _T("\037"));
iRemoveChars = 2;
break;
case 'c':
{
- lstrcpy(InsertThis, _T("\003"));
+ mir_tstrcpy(InsertThis, _T("\003"));
iRemoveChars = 2;
TCHAR szTemp[3];
- lstrcpyn(szTemp, p1 + 2, 3);
+ mir_tstrncpy(szTemp, p1 + 2, 3);
iFG = _ttoi(szTemp);
}
break;
case 'C':
if (p1[2] == '%' && p1[3] == 'F') {
- lstrcpy(InsertThis, _T("\00399,99"));
+ mir_tstrcpy(InsertThis, _T("\00399,99"));
iRemoveChars = 4;
}
else {
- lstrcpy(InsertThis, _T("\00399"));
+ mir_tstrcpy(InsertThis, _T("\00399"));
iRemoveChars = 2;
}
iFG = -1;
break;
case 'f':
if (p1 - 3 >= pszText && p1[-3] == '\003')
- lstrcpy(InsertThis, _T(","));
+ mir_tstrcpy(InsertThis, _T(","));
else if (iFG >= 0)
mir_sntprintf(InsertThis, SIZEOF(InsertThis), _T("\003%u,"), iFG);
else
- lstrcpy(InsertThis, _T("\00399,"));
+ mir_tstrcpy(InsertThis, _T("\00399,"));
iRemoveChars = 2;
break;
@@ -470,12 +470,12 @@ static void DoChatFormatting(TCHAR* pszText)
if (iFG >= 0)
mir_sntprintf(InsertThis, SIZEOF(InsertThis), _T("\003%u,99"), iFG);
else
- lstrcpy(InsertThis, _T("\00399,99"));
+ mir_tstrcpy(InsertThis, _T("\00399,99"));
iRemoveChars = 2;
break;
case '%':
- lstrcpy(InsertThis, _T("%"));
+ mir_tstrcpy(InsertThis, _T("%"));
iRemoveChars = 2;
break;
@@ -484,10 +484,10 @@ static void DoChatFormatting(TCHAR* pszText)
break;
}
- MoveMemory(p1 + lstrlen(InsertThis), p1 + iRemoveChars, sizeof(TCHAR)*(lstrlen(p1) - iRemoveChars + 1));
- CopyMemory(p1, InsertThis, sizeof(TCHAR)*lstrlen(InsertThis));
- if (iRemoveChars || lstrlen(InsertThis))
- p1 += lstrlen(InsertThis);
+ MoveMemory(p1 + mir_tstrlen(InsertThis), p1 + iRemoveChars, sizeof(TCHAR)*(mir_tstrlen(p1) - iRemoveChars + 1));
+ CopyMemory(p1, InsertThis, sizeof(TCHAR)*mir_tstrlen(InsertThis));
+ if (iRemoveChars || mir_tstrlen(InsertThis))
+ p1 += mir_tstrlen(InsertThis);
else
p1++;
}
@@ -517,8 +517,8 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam, LPARAM lParam)
case GC_USER_MESSAGE:
if (gch && gch->ptszText && *gch->ptszText) {
- TCHAR* pszText = new TCHAR[lstrlen(gch->ptszText) + 1000];
- lstrcpy(pszText, gch->ptszText);
+ TCHAR* pszText = new TCHAR[mir_tstrlen(gch->ptszText) + 1000];
+ mir_tstrcpy(pszText, gch->ptszText);
DoChatFormatting(pszText);
PostIrcMessageWnd(p1, NULL, pszText);
delete[]pszText;
@@ -877,8 +877,8 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam)
TCHAR stzChanName[100];
const TCHAR* temp = _tcschr(gcmi->pszID, ' ');
- int len = min(((temp == NULL) ? lstrlen(gcmi->pszID) : (int)(temp - gcmi->pszID + 1)), SIZEOF(stzChanName) - 1);
- lstrcpyn(stzChanName, gcmi->pszID, len);
+ size_t len = min(((temp == NULL) ? mir_tstrlen(gcmi->pszID) : (int)(temp - gcmi->pszID + 1)), SIZEOF(stzChanName) - 1);
+ mir_tstrncpy(stzChanName, gcmi->pszID, len);
stzChanName[len] = 0;
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, stzChanName, NULL, NULL, NULL, NULL, NULL, false, false, 0);
BOOL bServOwner = strchr(sUserModes.c_str(), 'q') == NULL ? FALSE : TRUE;
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index 8046eebf0d..30c1e217f2 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -84,7 +84,7 @@ CMString __stdcall GetWord(const TCHAR* text, int index)
const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index)
{
- if (!text || !lstrlen(text))
+ if (!text || !mir_tstrlen(text))
return text;
const TCHAR* temp = text;
@@ -108,10 +108,10 @@ const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index)
return temp;
}
-void __stdcall RemoveLinebreaks(CMString& Message)
+void __stdcall RemoveLinebreaks(CMString &Message)
{
while (Message.Find(_T("\r\n\r\n"), 0) != -1)
- ReplaceString(Message, _T("\r\n\r\n"), _T("\r\n"));
+ Message.Replace(_T("\r\n\r\n"), _T("\r\n"));
if (Message.Find(_T("\r\n"), 0) == 0)
Message.Delete(0, 2);
@@ -120,34 +120,6 @@ void __stdcall RemoveLinebreaks(CMString& Message)
Message.Delete(Message.GetLength() - 2, 2);
}
-String& __stdcall ReplaceString(String& text, const char* replaceme, const char* newword)
-{
- if (!text.IsEmpty() && replaceme != NULL) {
- int i = 0;
- while ((i = text.Find(replaceme, i)) != -1) {
- text.Delete(i, lstrlenA(replaceme));
- text.Insert(i, newword);
- i = i + lstrlenA(newword);
- }
- }
-
- return text;
-}
-
-CMString& __stdcall ReplaceString(CMString& text, const TCHAR* replaceme, const TCHAR* newword)
-{
- if (!text.IsEmpty() && replaceme != NULL) {
- int i = 0;
- while ((i = text.Find(replaceme, i)) != -1) {
- text.Delete(i, lstrlen(replaceme));
- text.Insert(i, newword);
- i = i + lstrlen(newword);
- }
- }
-
- return text;
-}
-
char* __stdcall IrcLoadFile(TCHAR* szPath)
{
char * szContainer = NULL;
@@ -169,7 +141,7 @@ char* __stdcall IrcLoadFile(TCHAR* szPath)
int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string)
{
- if (wild == NULL || !lstrlen(wild) || string == NULL || !lstrlen(string))
+ if (wild == NULL || !mir_tstrlen(wild) || string == NULL || !mir_tstrlen(string))
return 1;
const TCHAR *cp = NULL, *mp = NULL;
@@ -210,7 +182,7 @@ bool CIrcProto::IsChannel(const TCHAR* sName)
return (sChannelPrefixes.Find(sName[0]) != -1);
}
-String __stdcall GetWord(const char* text, int index)
+CMStringA __stdcall GetWord(const char* text, int index)
{
if (text && text[0]) {
char* p1 = (char*)text;
@@ -236,11 +208,11 @@ String __stdcall GetWord(const char* text, int index)
p2 = strchr(p1, '\0');
if (p1 != p2)
- return String(p1, p2 - p1 + 1);
+ return CMStringA(p1, p2 - p1 + 1);
}
}
- return String();
+ return CMStringA();
}
bool CIrcProto::IsChannel(const char* sName)
@@ -337,10 +309,10 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
// fix foreground index
if (text[1] > 47 && text[1] < 58 && text[1] != '\0')
- lstrcpyn(buf, text, 3);
+ mir_tstrncpy(buf, text, 3);
else
- lstrcpyn(buf, text, 2);
- text += lstrlen(buf);
+ mir_tstrncpy(buf, text, 2);
+ text += mir_tstrlen(buf);
iFG = _ttoi(buf);
// fix background color
@@ -348,10 +320,10 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
text++;
if (text[1] > 47 && text[1] < 58 && text[1] != '\0')
- lstrcpyn(buf, text, 3);
+ mir_tstrncpy(buf, text, 3);
else
- lstrcpyn(buf, text, 2);
- text += lstrlen(buf);
+ mir_tstrncpy(buf, text, 2);
+ text += mir_tstrlen(buf);
iBG = _ttoi(buf);
}
}
@@ -603,20 +575,20 @@ bool CIrcProto::AddWindowItemData(CMString window, const TCHAR* pszLimit, const
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, window.c_str(), NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi) {
if (pszLimit) {
- wi->pszLimit = (TCHAR*)realloc(wi->pszLimit, sizeof(TCHAR)*(lstrlen(pszLimit) + 1));
- lstrcpy(wi->pszLimit, pszLimit);
+ wi->pszLimit = (TCHAR*)realloc(wi->pszLimit, sizeof(TCHAR)*(mir_tstrlen(pszLimit) + 1));
+ mir_tstrcpy(wi->pszLimit, pszLimit);
}
if (pszMode) {
- wi->pszMode = (TCHAR*)realloc(wi->pszMode, sizeof(TCHAR)*(lstrlen(pszMode) + 1));
- lstrcpy(wi->pszMode, pszMode);
+ wi->pszMode = (TCHAR*)realloc(wi->pszMode, sizeof(TCHAR)*(mir_tstrlen(pszMode) + 1));
+ mir_tstrcpy(wi->pszMode, pszMode);
}
if (pszPassword) {
- wi->pszPassword = (TCHAR*)realloc(wi->pszPassword, sizeof(TCHAR)*(lstrlen(pszPassword) + 1));
- lstrcpy(wi->pszPassword, pszPassword);
+ wi->pszPassword = (TCHAR*)realloc(wi->pszPassword, sizeof(TCHAR)*(mir_tstrlen(pszPassword) + 1));
+ mir_tstrcpy(wi->pszPassword, pszPassword);
}
if (pszTopic) {
- wi->pszTopic = (TCHAR*)realloc(wi->pszTopic, sizeof(TCHAR)*(lstrlen(pszTopic) + 1));
- lstrcpy(wi->pszTopic, pszTopic);
+ wi->pszTopic = (TCHAR*)realloc(wi->pszTopic, sizeof(TCHAR)*(mir_tstrlen(pszTopic) + 1));
+ mir_tstrcpy(wi->pszTopic, pszTopic);
}
SetChannelSBText(window, wi);
@@ -633,7 +605,7 @@ void CIrcProto::FindLocalIP(HANDLE con) // inspiration from jabber
struct sockaddr_in saddr;
int len = sizeof(saddr);
getsockname(socket, (struct sockaddr *) &saddr, &len);
- lstrcpynA(m_myLocalHost, inet_ntoa(saddr.sin_addr), 49);
+ mir_strncpy(m_myLocalHost, inet_ntoa(saddr.sin_addr), 49);
m_myLocalPort = ntohs(saddr.sin_port);
}
}
diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp
index e02ab4ed5f..daaa364a14 100644
--- a/protocols/IRCG/src/ui_utils.cpp
+++ b/protocols/IRCG/src/ui_utils.cpp
@@ -314,7 +314,7 @@ TCHAR* CCtrlCombo::GetItemText(int index, TCHAR *buf, int size)
{
TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
- lstrcpyn(buf, result, size);
+ mir_tstrncpy(buf, result, size);
return buf;
}
@@ -402,7 +402,7 @@ TCHAR* CCtrlListBox::GetItemText(int index, TCHAR *buf, int size)
{
TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
- lstrcpyn(buf, result, size);
+ mir_tstrncpy(buf, result, size);
return buf;
}
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp
index 38ea133fb6..c5389d8607 100644
--- a/protocols/IRCG/src/userinfo.cpp
+++ b/protocols/IRCG/src/userinfo.cpp
@@ -117,7 +117,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
S += _T(" (");
S += dbv.ptszVal;
S += _T(")");
- if ((lstrlen(temp) < 4 && lstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
+ if ((mir_tstrlen(temp) < 4 && mir_tstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
MessageBox(NULL, TranslateTS(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
db_free(&dbv);
return FALSE;
@@ -126,7 +126,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
}
GetDlgItemText(m_hwnd, IDC_WILDCARD, temp, SIZEOF(temp));
- if (lstrlen(GetWord(temp, 0).c_str()))
+ if (mir_tstrlen(GetWord(temp, 0).c_str()))
p->ppro->setTString(p->hContact, "UWildcard", GetWord(temp, 0).c_str());
else
db_unset(p->hContact, p->ppro->m_szModuleName, "UWildcard");
@@ -135,13 +135,13 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
p->ppro->setByte(p->hContact, "AdvancedMode", bAdvanced);
GetDlgItemText(m_hwnd, IDC_USER, temp, SIZEOF(temp));
- if (lstrlen(GetWord(temp, 0).c_str()))
+ if (mir_tstrlen(GetWord(temp, 0).c_str()))
p->ppro->setTString(p->hContact, "UUser", GetWord(temp, 0).c_str());
else
db_unset(p->hContact, p->ppro->m_szModuleName, "UUser");
GetDlgItemText(m_hwnd, IDC_HOST, temp, SIZEOF(temp));
- if (lstrlen(GetWord(temp, 0).c_str()))
+ if (mir_tstrlen(GetWord(temp, 0).c_str()))
p->ppro->setTString(p->hContact, "UHost", GetWord(temp, 0).c_str());
else
db_unset(p->hContact, p->ppro->m_szModuleName, "UHost");
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index 52b9d32726..0e48fc7432 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -282,10 +282,10 @@ void CListDlg::OnInitDialog()
lvC.cx = COLUMNS_SIZES[index];
switch (index) {
- case 0: lstrcpy(szBuffer, TranslateT("Channel")); break;
- case 1: lstrcpy(szBuffer, _T("#")); break;
- case 2: lstrcpy(szBuffer, TranslateT("Mode")); break;
- case 3: lstrcpy(szBuffer, TranslateT("Topic")); break;
+ case 0: mir_tstrcpy(szBuffer, TranslateT("Channel")); break;
+ case 1: mir_tstrcpy(szBuffer, _T("#")); break;
+ case 2: mir_tstrcpy(szBuffer, TranslateT("Mode")); break;
+ case 3: mir_tstrcpy(szBuffer, TranslateT("Topic")); break;
}
lvC.pszText = szBuffer;
m_list.InsertColumn(index, &lvC);
@@ -433,7 +433,7 @@ static int CALLBACK ListViewSort(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSo
lvm.pszText = temp2;
param->pList->GetItem(&lvm);
if (param->iSubItem != 1) {
- if (lstrlen(temp1) != 0 && lstrlen(temp2) != 0)
+ if (mir_tstrlen(temp1) != 0 && mir_tstrlen(temp2) != 0)
return lstrcmpi(temp1, temp2);
return (*temp1 == 0) ? 1 : -1;
@@ -511,7 +511,7 @@ void CJoinDlg::OnInitDialog()
for (int i = 0; i < 20; i++) {
if (!GetWord(dbv.ptszVal, i).IsEmpty()) {
CMString S = GetWord(dbv.ptszVal, i);
- ReplaceString(S, _T("%newl"), _T(" "));
+ S.Replace(_T("%newl"), _T(" "));
SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)S.c_str());
}
}
@@ -535,7 +535,7 @@ void CJoinDlg::OnOk(CCtrlButton*)
m_proto->PostIrcMessage(_T("/JOIN #%s"), szTemp);
CMString S = szTemp;
- ReplaceString(S, _T(" "), _T("%newl"));
+ S.Replace(_T(" "), _T("%newl"));
CMString SL = S;
DBVARIANT dbv;
@@ -626,7 +626,7 @@ void CQuickDlg::OnOk(CCtrlButton*)
int i = m_serverCombo.GetCurSel();
SERVER_INFO* pData = (SERVER_INFO*)m_serverCombo.GetItemData(i);
if (pData && (INT_PTR)pData != CB_ERR) {
- lstrcpyA(m_proto->m_network, pData->m_group);
+ mir_strcpy(m_proto->m_network, pData->m_group);
pData->m_iSSL = 0;
if (IsDlgButtonChecked(m_hwnd, IDC_SSL_ON))
pData->m_iSSL = 2;
@@ -761,7 +761,7 @@ void CQuestionDlg::OnOk(CCtrlButton*)
TCHAR* n = (TCHAR*)alloca(sizeof(TCHAR)*(j + 2));
GetDlgItemText(m_hwnd, IDC_HIDDENEDIT, n, j + 1);
CMString S(n);
- ReplaceString(S, text, l);
+ S.Replace(text, l);
m_proto->PostIrcMessageWnd(NULL, NULL, (TCHAR*)S.c_str());
delete[]m;
@@ -919,7 +919,7 @@ void CManagerDlg::OnClose()
CMString S1 = temp;
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
- ReplaceString(S1, _T(" "), _T("%¤"));
+ S1.Replace(_T(" "), _T("%¤"));
#endif
S += _T(" ") + S1;
}
@@ -945,16 +945,16 @@ void CManagerDlg::OnAdd(CCtrlButton*)
TCHAR temp[100];
TCHAR mode[3];
if (m_radio1.GetState()) {
- lstrcpy(mode, _T("+b"));
- lstrcpyn(temp, TranslateT("Add ban"), 100);
+ mir_tstrcpy(mode, _T("+b"));
+ mir_tstrncpy(temp, TranslateT("Add ban"), 100);
}
if (m_radio2.GetState()) {
- lstrcpy(mode, _T("+I"));
- lstrcpyn(temp, TranslateT("Add invite"), 100);
+ mir_tstrcpy(mode, _T("+I"));
+ mir_tstrncpy(temp, TranslateT("Add invite"), 100);
}
if (m_radio3.GetState()) {
- lstrcpy(mode, _T("+e"));
- lstrcpyn(temp, TranslateT("Add exception"), 100);
+ mir_tstrcpy(mode, _T("+e"));
+ mir_tstrncpy(temp, TranslateT("Add exception"), 100);
}
m_add.Disable();
@@ -987,16 +987,16 @@ void CManagerDlg::OnEdit(CCtrlButton*)
TCHAR temp[100];
TCHAR mode[3];
if (m_radio1.GetState()) {
- lstrcpy(mode, _T("b"));
- lstrcpyn(temp, TranslateT("Edit ban"), 100);
+ mir_tstrcpy(mode, _T("b"));
+ mir_tstrncpy(temp, TranslateT("Edit ban"), 100);
}
if (m_radio2.GetState()) {
- lstrcpy(mode, _T("I"));
- lstrcpyn(temp, TranslateT("Edit invite?"), 100);
+ mir_tstrcpy(mode, _T("I"));
+ mir_tstrncpy(temp, TranslateT("Edit invite?"), 100);
}
if (m_radio3.GetState()) {
- lstrcpy(mode, _T("e"));
- lstrcpyn(temp, TranslateT("Edit exception?"), 100);
+ mir_tstrcpy(mode, _T("e"));
+ mir_tstrncpy(temp, TranslateT("Edit exception?"), 100);
}
CQuestionDlg* dlg = new CQuestionDlg(m_proto, this);
@@ -1033,16 +1033,16 @@ void CManagerDlg::OnRemove(CCtrlButton*)
CMString user = GetWord(m, 0);
if (m_radio1.GetState()) {
- lstrcpy(mode, _T("-b"));
- lstrcpyn(temp, TranslateT("Remove ban?"), 100);
+ mir_tstrcpy(mode, _T("-b"));
+ mir_tstrncpy(temp, TranslateT("Remove ban?"), 100);
}
if (m_radio2.GetState()) {
- lstrcpy(mode, _T("-I"));
- lstrcpyn(temp, TranslateT("Remove invite?"), 100);
+ mir_tstrcpy(mode, _T("-I"));
+ mir_tstrncpy(temp, TranslateT("Remove invite?"), 100);
}
if (m_radio3.GetState()) {
- lstrcpy(mode, _T("-e"));
- lstrcpyn(temp, TranslateT("Remove exception?"), 100);
+ mir_tstrcpy(mode, _T("-e"));
+ mir_tstrncpy(temp, TranslateT("Remove exception?"), 100);
}
TCHAR window[256];
@@ -1090,58 +1090,58 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
CMString appendixremove = _T("");
if (wi->pszMode && _tcschr(wi->pszMode, 't')) {
if (!m_check1.GetState())
- lstrcat(toremove, _T("t"));
+ mir_tstrcat(toremove, _T("t"));
}
else if (m_check1.GetState())
- lstrcat(toadd, _T("t"));
+ mir_tstrcat(toadd, _T("t"));
if (wi->pszMode && _tcschr(wi->pszMode, 'n')) {
if (!m_check2.GetState())
- lstrcat(toremove, _T("n"));
+ mir_tstrcat(toremove, _T("n"));
}
else if (m_check2.GetState())
- lstrcat(toadd, _T("n"));
+ mir_tstrcat(toadd, _T("n"));
if (wi->pszMode && _tcschr(wi->pszMode, 'i')) {
if (!m_check3.GetState())
- lstrcat(toremove, _T("i"));
+ mir_tstrcat(toremove, _T("i"));
}
else if (m_check3.GetState())
- lstrcat(toadd, _T("i"));
+ mir_tstrcat(toadd, _T("i"));
if (wi->pszMode && _tcschr(wi->pszMode, 'm')) {
if (!m_check4.GetState())
- lstrcat(toremove, _T("m"));
+ mir_tstrcat(toremove, _T("m"));
}
else if (m_check4.GetState())
- lstrcat(toadd, _T("m"));
+ mir_tstrcat(toadd, _T("m"));
if (wi->pszMode && _tcschr(wi->pszMode, 'p')) {
if (!m_check7.GetState())
- lstrcat(toremove, _T("p"));
+ mir_tstrcat(toremove, _T("p"));
}
else if (m_check7.GetState())
- lstrcat(toadd, _T("p"));
+ mir_tstrcat(toadd, _T("p"));
if (wi->pszMode && _tcschr(wi->pszMode, 's')) {
if (!m_check8.GetState())
- lstrcat(toremove, _T("s"));
+ mir_tstrcat(toremove, _T("s"));
}
else if (m_check8.GetState())
- lstrcat(toadd, _T("s"));
+ mir_tstrcat(toadd, _T("s"));
if (wi->pszMode && _tcschr(wi->pszMode, 'c')) {
if (!m_check9.GetState())
- lstrcat(toremove, _T("c"));
+ mir_tstrcat(toremove, _T("c"));
}
else if (m_check9.GetState())
- lstrcat(toadd, _T("c"));
+ mir_tstrcat(toadd, _T("c"));
CMString Key = _T("");
CMString Limit = _T("");
if (wi->pszMode && wi->pszPassword && _tcschr(wi->pszMode, 'k')) {
if (!m_check5.GetState()) {
- lstrcat(toremove, _T("k"));
+ mir_tstrcat(toremove, _T("k"));
appendixremove += _T(" ") + CMString(wi->pszPassword);
}
else if (GetWindowTextLength(m_key.GetHwnd())) {
@@ -1149,15 +1149,15 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
m_key.GetText(temp, 14);
if (Key != temp) {
- lstrcat(toremove, _T("k"));
- lstrcat(toadd, _T("k"));
+ mir_tstrcat(toremove, _T("k"));
+ mir_tstrcat(toadd, _T("k"));
appendixadd += _T(" ") + CMString(temp);
appendixremove += _T(" ") + CMString(wi->pszPassword);
}
}
}
else if (m_check5.GetState() && GetWindowTextLength(m_key.GetHwnd())) {
- lstrcat(toadd, _T("k"));
+ mir_tstrcat(toadd, _T("k"));
appendixadd += _T(" ");
TCHAR temp[400];
@@ -1167,18 +1167,18 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
if (_tcschr(wi->pszMode, 'l')) {
if (!m_check6.GetState())
- lstrcat(toremove, _T("l"));
+ mir_tstrcat(toremove, _T("l"));
else if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_LIMIT))) {
TCHAR temp[15];
GetDlgItemText(m_hwnd, IDC_LIMIT, temp, SIZEOF(temp));
if (wi->pszLimit && lstrcmpi(wi->pszLimit, temp)) {
- lstrcat(toadd, _T("l"));
+ mir_tstrcat(toadd, _T("l"));
appendixadd += _T(" ") + CMString(temp);
}
}
}
else if (m_check6.GetState() && GetWindowTextLength(m_limit.GetHwnd())) {
- lstrcat(toadd, _T("l"));
+ mir_tstrcat(toadd, _T("l"));
appendixadd += _T(" ");
TCHAR temp[15];
@@ -1186,19 +1186,19 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
appendixadd += temp;
}
- if (lstrlen(toadd) || lstrlen(toremove)) {
+ if (mir_tstrlen(toadd) || mir_tstrlen(toremove)) {
TCHAR temp[500];
- lstrcpy(temp, _T("/mode "));
- lstrcat(temp, window);
- lstrcat(temp, _T(" "));
- if (lstrlen(toremove))
+ mir_tstrcpy(temp, _T("/mode "));
+ mir_tstrcat(temp, window);
+ mir_tstrcat(temp, _T(" "));
+ if (mir_tstrlen(toremove))
mir_sntprintf(temp, 499, _T("%s-%s"), temp, toremove);
- if (lstrlen(toadd))
+ if (mir_tstrlen(toadd))
mir_sntprintf(temp, 499, _T("%s+%s"), temp, toadd);
if (!appendixremove.IsEmpty())
- lstrcat(temp, appendixremove.c_str());
+ mir_tstrcat(temp, appendixremove.c_str());
if (!appendixadd.IsEmpty())
- lstrcat(temp, appendixadd.c_str());
+ mir_tstrcat(temp, appendixadd.c_str());
m_proto->PostIrcMessage(temp);
}
}
@@ -1249,11 +1249,11 @@ void CManagerDlg::ApplyQuestion()
GetDlgItemText(m_hwnd, IDC_CAPTION, window, SIZEOF(window));
TCHAR mode[3];
- lstrcpy(mode, _T("+b"));
+ mir_tstrcpy(mode, _T("+b"));
if (m_radio2.GetState())
- lstrcpy(mode, _T("+I"));
+ mir_tstrcpy(mode, _T("+I"));
if (m_radio3.GetState())
- lstrcpy(mode, _T("+e"));
+ mir_tstrcpy(mode, _T("+e"));
m_list.ResetContent();
m_radio1.Disable();
m_radio2.Disable();
@@ -1292,7 +1292,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window)
if (!S.IsEmpty()) {
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
- ReplaceString(S, _T("%¤"), _T(" "));
+ S.Replace(_T("%¤"), _T(" "));
#endif
m_topic.SendMsg(CB_ADDSTRING, 0, (LPARAM)S.c_str());
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index 048195df0b..1dbc41d834 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -1223,7 +1223,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen
PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
ai.format = PA_FORMAT_JPEG; // this is for error only
ai.hContact = pCookieData->hContact;
- lstrcpyn(ai.filename, pCookieData->szFile, SIZEOF(ai.filename));
+ mir_tstrncpy(ai.filename, pCookieData->szFile, SIZEOF(ai.filename));
AddAvatarExt(PA_FORMAT_JPEG, ai.filename);
ppro->FreeCookie(pSnacHeader->dwRef);
@@ -1280,7 +1280,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen
ppro->setByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
ai.format = dwPaFormat; // set the format
- lstrcpyn(ai.filename, tszImageFile, SIZEOF(ai.filename));
+ mir_tstrncpy(ai.filename, tszImageFile, SIZEOF(ai.filename));
int out = _topen(tszImageFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
if (out != -1) {
diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp
index e66aedc990..b357356640 100644
--- a/protocols/IcqOscarJ/src/icq_filerequests.cpp
+++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp
@@ -80,12 +80,10 @@ void CIcqProto::handleFileAck(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwCooki
unpackString(&buf, pszFileName, wFilenameLength);
pszFileName[wFilenameLength] = '\0';
}
- wLen = wLen - 2 - wFilenameLength;
+ wLen -= wFilenameLength+2;
- if (wLen >= 4) { // Total filesize
+ if (wLen >= 4)
unpackLEDWord(&buf, &dwFileSize);
- wLen -= 4;
- }
else
dwFileSize = 0;
@@ -111,7 +109,7 @@ filetransfer* CIcqProto::CreateFileTransfer(MCONTACT hContact, DWORD dwUin, int
// pszDescription points to a string with the reason
// buf points to the first data after the string
-void CIcqProto::handleFileRequest(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwCookie, DWORD dwID1, DWORD dwID2, char* pszDescription, int nVersion, BOOL bDC)
+void CIcqProto::handleFileRequest(PBYTE buf, size_t cbLen, DWORD dwUin, DWORD dwCookie, DWORD dwID1, DWORD dwID2, char* pszDescription, int nVersion, BOOL bDC)
{
BOOL bEmptyDesc = FALSE;
if (mir_strlen(pszDescription) == 0) {
@@ -121,7 +119,6 @@ void CIcqProto::handleFileRequest(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwC
// Empty port+pad
buf += 4;
- wLen -= 4;
// Filename
size_t wFilenameLength;
@@ -135,12 +132,9 @@ void CIcqProto::handleFileRequest(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwC
unpackString(&buf, pszFileName, wFilenameLength);
pszFileName[wFilenameLength] = '\0';
- wLen = wLen - 2 - wFilenameLength;
-
// Total filesize
DWORD dwFileSize;
unpackLEDWord(&buf, &dwFileSize);
- wLen -= 4;
int bAdded;
MCONTACT hContact = HContactFromUIN(dwUin, &bAdded);
@@ -183,7 +177,6 @@ void CIcqProto::handleDirectCancel(directconnect *dc, PBYTE buf, size_t wLen, WO
void CIcqProto::icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft)
{
DWORD dwCookie;
-
if (FindCookieByData(ft, &dwCookie, NULL))
FreeCookie(dwCookie); /* this bit stops a send that's waiting for acceptance */
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
index 4e1f00b779..5c91037b7c 100644
--- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp
+++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
@@ -352,7 +352,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszFile, MAX_PATH * 2);
- lstrcpyn(pai->filename, tszFile, SIZEOF(pai->filename)); // Avatar API does not support unicode :-(
+ mir_tstrncpy(pai->filename, tszFile, SIZEOF(pai->filename)); // Avatar API does not support unicode :-(
pai->format = dwPaFormat;
if (!IsAvatarChanged(pai->hContact, dbv.pbVal, dbv.cpbVal)) { // hashes are the same
@@ -370,7 +370,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
GetAvatarFileName(dwUIN, szUID, tszFile, MAX_PATH * 2);
GetAvatarData(pai->hContact, dwUIN, szUID, dbv.pbVal, dbv.cpbVal, tszFile);
- lstrcpyn(pai->filename, tszFile, SIZEOF(pai->filename)); // Avatar API does not support unicode :-(
+ mir_tstrncpy(pai->filename, tszFile, SIZEOF(pai->filename)); // Avatar API does not support unicode :-(
db_free(&dbv);
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 3dfa48c3e9..77b373cada 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -133,7 +133,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.colour = GetSysColor(COLOR_WINDOWTEXT);
fontid.deffontsettings.size = -11;
- lstrcpyn(fontid.deffontsettings.szFace, _T("MS Shell Dlg"), SIZEOF(fontid.deffontsettings.szFace));
+ mir_tstrncpy(fontid.deffontsettings.szFace, _T("MS Shell Dlg"), SIZEOF(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
_tcsncpy_s(fontid.name, LPGENT("Frame title"), _TRUNCATE);
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp
index 208076acf3..4f662909cd 100644
--- a/protocols/JabberG/src/jabber_api.cpp
+++ b/protocols/JabberG/src/jabber_api.cpp
@@ -288,7 +288,7 @@ int CJabberProto::AddFeatures(LPCTSTR szFeatures)
m_uEnabledFeatCapsDynamic |= fcp->jcbCap;
else
ret = false;
- szFeat += lstrlen(szFeat) + 1;
+ szFeat += mir_tstrlen(szFeat) + 1;
}
lck.unlock();
@@ -313,7 +313,7 @@ int CJabberProto::RemoveFeatures(LPCTSTR szFeatures)
else
ret = false; // indicate that there was an error removing at least one of the specified features
- szFeat += lstrlen(szFeat) + 1;
+ szFeat += mir_tstrlen(szFeat) + 1;
}
lck.unlock();
@@ -335,25 +335,25 @@ LPTSTR CJabberProto::GetResourceFeatures(LPCTSTR jid)
// calculate total necessary string length
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap)
- iLen += lstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
+ iLen += mir_tstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
for (i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
if (jcb & m_lstJabberFeatCapPairsDynamic[i]->jcbCap)
- iLen += lstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
+ iLen += mir_tstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
// allocate memory and fill it
LPTSTR str = (LPTSTR)mir_alloc(iLen * sizeof(TCHAR));
LPTSTR p = str;
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap) {
- lstrcpy(p, g_JabberFeatCapPairs[i].szFeature);
- p += lstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
+ mir_tstrcpy(p, g_JabberFeatCapPairs[i].szFeature);
+ p += mir_tstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
}
for (i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
if (jcb & m_lstJabberFeatCapPairsDynamic[i]->jcbCap) {
- lstrcpy(p, m_lstJabberFeatCapPairsDynamic[i]->szFeature);
- p += lstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
+ mir_tstrcpy(p, m_lstJabberFeatCapPairsDynamic[i]->szFeature);
+ p += mir_tstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
}
*p = 0; // extra zero terminator
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 22eba675e1..f431ea4b53 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -668,7 +668,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
if (ppro->m_options.ShowOSVersion) {
if (!GetOSDisplayString(szOsBuffer, SIZEOF(szOsBuffer)))
- lstrcpyn(szOsBuffer, _T(""), SIZEOF(szOsBuffer));
+ mir_tstrncpy(szOsBuffer, _T(""), SIZEOF(szOsBuffer));
else {
TCHAR *szOsWindows = _T("Microsoft Windows");
size_t nOsWindowsLength = _tcslen(szOsWindows);
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 07edd9ae80..93b1fd047f 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -534,7 +534,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
if (ptszStatusMsg && *ptszStatusMsg) {
TCHAR *bufPtr = url_buf;
for (TCHAR *p = _tcsstr(ptszStatusMsg, _T("http://")); p && *p; p = _tcsstr(p+1, _T("http://"))) {
- lstrcpyn(bufPtr, p, SIZEOF(url_buf) - (bufPtr - url_buf));
+ mir_tstrncpy(bufPtr, p, SIZEOF(url_buf) - (bufPtr - url_buf));
gc_item *pItem = sttFindGcMenuItem(gcmi, idx);
pItem->pszDesc = bufPtr;
pItem->uType = MENU_POPUPITEM;
@@ -754,7 +754,7 @@ public:
return;
JabberGcLogInviteDlgJidData *jidData = (JabberGcLogInviteDlgJidData *)mir_alloc(sizeof(JabberGcLogInviteDlgJidData));
- lstrcpy(jidData->jid, buf);
+ mir_tstrcpy(jidData->jid, buf);
CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_CHECKBOX;
@@ -1018,7 +1018,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
*p = 0;
mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s"), szMessage, him->m_tszResourceName, p + 2);
}
- else lstrcpyn(buf, szMessage, SIZEOF(buf));
+ else mir_tstrncpy(buf, szMessage, SIZEOF(buf));
UnEscapeChatTags(buf);
ppro->m_ThreadInfo->send(
@@ -1397,7 +1397,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
switch (gch->pDest->iType) {
case GC_USER_MESSAGE:
- if (gch->ptszText && lstrlen(gch->ptszText) > 0) {
+ if (gch->ptszText && mir_tstrlen(gch->ptszText) > 0) {
rtrimt(gch->ptszText);
if (m_bJabberOnline) {
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index cfacaf7996..b8ff053815 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -154,12 +154,12 @@ static void sttAppendBufRaw(StringBuf *buf, const char *str)
{
if (!str) return;
- int length = lstrlenA(str);
+ int length = mir_strlen(str);
if (buf->size - buf->offset < length + 1) {
buf->size += (length + STRINGBUF_INCREMENT);
buf->buf = (char *)mir_realloc(buf->buf, buf->size);
}
- lstrcpyA(buf->buf + buf->offset, str);
+ mir_strcpy(buf->buf + buf->offset, str);
buf->offset += length;
}
@@ -354,7 +354,7 @@ void CJabberDlgConsole::OnInitDialog()
*m_proto->m_filterInfo.pattern = 0;
ptrT tszPattern( m_proto->getTStringA("consoleWnd_fpattern"));
if (tszPattern != NULL)
- lstrcpyn(m_proto->m_filterInfo.pattern, tszPattern, SIZEOF(m_proto->m_filterInfo.pattern));
+ mir_tstrncpy(m_proto->m_filterInfo.pattern, tszPattern, SIZEOF(m_proto->m_filterInfo.pattern));
sttJabberConsoleRebuildStrings(m_proto, GetDlgItem(m_hwnd, IDC_CB_FILTER));
SetWindowText(GetDlgItem(m_hwnd, IDC_CB_FILTER), m_proto->m_filterInfo.pattern);
@@ -559,7 +559,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
if (len > SIZEOF(m_proto->m_filterInfo.pattern)) {
TCHAR *buf = (TCHAR *)_alloca(len * sizeof(TCHAR));
SendDlgItemMessage(m_hwnd, IDC_CB_FILTER, CB_GETLBTEXT, idx, (LPARAM)buf);
- lstrcpyn(m_proto->m_filterInfo.pattern, buf, SIZEOF(m_proto->m_filterInfo.pattern));
+ mir_tstrncpy(m_proto->m_filterInfo.pattern, buf, SIZEOF(m_proto->m_filterInfo.pattern));
}
else SendDlgItemMessage(m_hwnd, IDC_CB_FILTER, CB_GETLBTEXT, idx, (LPARAM)m_proto->m_filterInfo.pattern);
}
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index 078cbcc98f..c9d6cdd7a1 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -298,7 +298,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
mir_free(pFileName);
- int len = lstrlen(ptszResource) + lstrlen(ft->jid) + 2;
+ int len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2;
TCHAR *fulljid = (TCHAR *)alloca(sizeof(TCHAR) * len);
mir_sntprintf(fulljid, len, _T("%s/%s"), ft->jid, ptszResource);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index 92e3e6f17f..1f639e7de6 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -116,7 +116,7 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
{
if (!text) text = _T("");
- int len = lstrlen(text);
+ int len = mir_tstrlen(text);
int fixedLen = len;
for (int i = 1; i < len; i++)
if ((text[i - 1] == _T('\n')) && (text[i] != _T('\r')))
@@ -147,7 +147,7 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
SetRect(&rcText, 0, 0, rcText.right-rcText.left, 0);
HDC hdcEdit = GetDC(GetDlgItem(hwndForm, IDC_INSTRUCTION));
HFONT hfntSave = (HFONT)SelectObject(hdcEdit, (HFONT)SendDlgItemMessage(hwndForm, IDC_INSTRUCTION, WM_GETFONT, 0, 0));
- DrawTextEx(hdcEdit, (TCHAR *)text, lstrlen(text), &rcText,
+ DrawTextEx(hdcEdit, (TCHAR *)text, mir_tstrlen(text), &rcText,
DT_CALCRECT|DT_EDITCONTROL|DT_TOP|DT_WORDBREAK, NULL);
SelectObject(hdcEdit, hfntSave);
ReleaseDC(GetDlgItem(hwndForm, IDC_INSTRUCTION), hdcEdit);
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index 98e0448916..0703cb8e20 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -244,20 +244,20 @@ void CJabberInfoFrame::ReloadFonts()
FontIDT fontid = {0};
fontid.cbSize = sizeof(fontid);
- lstrcpyn(fontid.group, _T("Jabber"), SIZEOF(fontid.group));
- lstrcpyn(fontid.name, _T("Frame title"), SIZEOF(fontid.name));
+ mir_tstrncpy(fontid.group, _T("Jabber"), SIZEOF(fontid.group));
+ mir_tstrncpy(fontid.name, _T("Frame title"), SIZEOF(fontid.name));
m_clTitle = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntTitle);
m_hfntTitle = CreateFontIndirect(&lfFont);
- lstrcpyn(fontid.name, _T("Frame text"), SIZEOF(fontid.name));
+ mir_tstrncpy(fontid.name, _T("Frame text"), SIZEOF(fontid.name));
m_clText = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntText);
m_hfntText = CreateFontIndirect(&lfFont);
ColourIDT colourid = {0};
colourid.cbSize = sizeof(colourid);
- lstrcpyn(colourid.group, _T("Jabber"), SIZEOF(colourid.group));
- lstrcpyn(colourid.name, _T("Background"), SIZEOF(colourid.name));
+ mir_tstrncpy(colourid.group, _T("Jabber"), SIZEOF(colourid.group));
+ mir_tstrncpy(colourid.name, _T("Background"), SIZEOF(colourid.name));
m_clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
UpdateSize();
@@ -370,7 +370,7 @@ void CJabberInfoFrame::PaintCompact(HDC hdc)
}
RECT rcText; SetRect(&rcText, cx_icon + SZ_FRAMEPADDING + SZ_ICONSPACING, 0, rc.right - SZ_FRAMEPADDING, rc.bottom);
- DrawText(hdc, item.m_pszText, lstrlen(item.m_pszText), &rcText, DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS);
+ DrawText(hdc, item.m_pszText, mir_tstrlen(item.m_pszText), &rcText, DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS);
}
else {
if (item.m_hIcolibIcon) {
@@ -433,7 +433,7 @@ void CJabberInfoFrame::PaintNormal(HDC hdc)
SetTextColor(hdc, depth ? m_clText : m_clTitle);
RECT rcText; SetRect(&rcText, cx, cy, rc.right - SZ_FRAMEPADDING, cy + line_height);
- DrawText(hdc, item.m_pszText, lstrlen(item.m_pszText), &rcText, DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS);
+ DrawText(hdc, item.m_pszText, mir_tstrlen(item.m_pszText), &rcText, DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS);
RemoveTooltip(item.m_tooltipId);
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 330f472c40..13a468bf2c 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -546,13 +546,13 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
rc.bottom -= (rc.bottom - rc.top) / 2;
rc.left += 20;
SetTextColor(lpdis->hDC, clLine1);
- DrawText(lpdis->hDC, info->line1, lstrlen(info->line1), &rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
+ DrawText(lpdis->hDC, info->line1, mir_tstrlen(info->line1), &rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
rc = lpdis->rcItem;
rc.top += (rc.bottom - rc.top) / 2;
rc.left += 20;
SetTextColor(lpdis->hDC, clLine2);
- DrawText(lpdis->hDC, info->line2, lstrlen(info->line2), &rc, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS);
+ DrawText(lpdis->hDC, info->line2, mir_tstrlen(info->line2), &rc, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS);
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("group"), 16, 16, 0, NULL, DI_NORMAL);
switch (info->overlay) {
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index e1d60fb20e..f22f8e0137 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -257,7 +257,7 @@ static HICON ExtractIconFromPath(const char *path, BOOL * needFree)
char file[MAX_PATH],fileFull[MAX_PATH];
int n;
HICON hIcon;
- lstrcpynA(file,path,sizeof(file));
+ mir_strncpy(file,path,sizeof(file));
comma=strrchr(file,',');
if (comma == NULL) n=0;
else {n=atoi(comma+1); *comma=0;}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 41e11c9f84..4685104f4e 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -116,8 +116,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
-#define StringCchCopy(x,y,z) lstrcpyn((x),(z),(y))
-#define StringCchCat(x,y,z) lstrcat((x),(z))
+#define StringCchCopy(x,y,z) mir_tstrncpy((x),(z),(y))
+#define StringCchCat(x,y,z) mir_tstrcat((x),(z))
// slightly modified sample from MSDN
BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
@@ -336,7 +336,7 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo *pInfo)
if (m_options.ShowOSVersion) {
TCHAR os[256] = {0};
if (!GetOSDisplayString(os, SIZEOF(os)))
- lstrcpyn(os, _T("Microsoft Windows"), SIZEOF(os));
+ mir_tstrncpy(os, _T("Microsoft Windows"), SIZEOF(os));
query << XCHILD(_T("os"), os);
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 84232b04e0..b8737f75b7 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -1337,7 +1337,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
}
TCHAR szJid[JABBER_MAX_JID_LEN];
- lstrcpyn(szJid, from, SIZEOF(szJid));
+ mir_tstrncpy(szJid, from, SIZEOF(szJid));
TCHAR *res = _tcschr(szJid, _T('/'));
if (res != NULL)
*res = 0;
@@ -1377,7 +1377,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo)
}
TCHAR szJid[JABBER_MAX_JID_LEN];
- lstrcpyn(szJid, from, SIZEOF(szJid));
+ mir_tstrncpy(szJid, from, SIZEOF(szJid));
TCHAR *res = _tcschr(szJid, _T('/'));
if (res != NULL)
*res = 0;
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index 3776b525be..5dce9f8939 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -250,7 +250,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) dat);
// Populate displayed list from iqNode
- lstrcpyn(title, TranslateT("JID List"), SIZEOF(title));
+ mir_tstrncpy(title, TranslateT("JID List"), SIZEOF(title));
if ((dat=(JABBER_MUC_JIDLIST_INFO *) lParam) != NULL) {
HXML iqNode = dat->iqNode;
if (iqNode != NULL) {
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index d5a0fc137e..f46c8ff619 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -411,7 +411,7 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
if (resource->m_tszResourceName && !_tcschr(jid, '/'))
mir_sntprintf(szFullJid, SIZEOF(szFullJid), _T("%s/%s"), jid, resource->m_tszResourceName);
else
- lstrcpyn(szFullJid, jid, SIZEOF(szFullJid));
+ mir_tstrncpy(szFullJid, jid, SIZEOF(szFullJid));
setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 101a9cfa00..c2c13b2549 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -38,7 +38,7 @@ static TCHAR *StrTrimCopy(TCHAR *str)
if (!*str) return mir_tstrdup(str);
TCHAR *res = mir_tstrdup(str);
- for (TCHAR *p = res + lstrlen(res) - 1; p >= res; --p) {
+ for (TCHAR *p = res + mir_tstrlen(res) - 1; p >= res; --p) {
if (_istspace(*p))
*p = 0;
else
@@ -85,8 +85,8 @@ void CNoteItem::SetData(TCHAR *title, TCHAR *from, TCHAR *text, TCHAR *tags)
m_szFrom = StrTrimCopy(from);
const TCHAR *szTags = tags;
- TCHAR *p = m_szTags = (TCHAR *)mir_alloc((lstrlen(szTags) + 2 /*for double zero*/) * sizeof(TCHAR));
- TCHAR *q = m_szTagsStr = (TCHAR *)mir_alloc((lstrlen(szTags) + 1) * sizeof(TCHAR));
+ TCHAR *p = m_szTags = (TCHAR *)mir_alloc((mir_tstrlen(szTags) + 2 /*for double zero*/) * sizeof(TCHAR));
+ TCHAR *q = m_szTagsStr = (TCHAR *)mir_alloc((mir_tstrlen(szTags) + 1) * sizeof(TCHAR));
for (; szTags && *szTags; ++szTags) {
if (_istspace(*szTags))
continue;
@@ -108,7 +108,7 @@ bool CNoteItem::HasTag(const TCHAR *szTag)
if (!szTag || !*szTag)
return true;
- for (TCHAR *p = m_szTags; p && *p; p = p + lstrlen(p) + 1)
+ for (TCHAR *p = m_szTags; p && *p; p = p + mir_tstrlen(p) + 1)
if (!lstrcmp(p, szTag))
return true;
@@ -479,7 +479,7 @@ private:
LIST<TCHAR> tagSet(5, _tcscmp);
for (int i = 0; i < m_proto->m_notes.getCount(); i++) {
TCHAR *tags = m_proto->m_notes[i].GetTags();
- for (TCHAR *tag = tags; tag && *tag; tag = tag + lstrlen(tag) + 1)
+ for (TCHAR *tag = tags; tag && *tag; tag = tag + mir_tstrlen(tag) + 1)
if (!tagSet.find(tag))
tagSet.insert(tag);
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index f4171a6eba..911bb861a5 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -334,7 +334,7 @@ static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlC
{
TCHAR *user = txtUsername.GetText();
TCHAR *server = cbServer.GetText();
- int len = lstrlen(user) + lstrlen(server) + 2;
+ int len = mir_tstrlen(user) + mir_tstrlen(server) + 2;
TCHAR *jid = (TCHAR *)mir_alloc(len * sizeof(TCHAR));
mir_sntprintf(jid, len, _T("%s@%s"), user, server);
ppro->setTString("jid", jid);
@@ -1327,7 +1327,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
if (Data)
{
jid=xmlGetText(Data);
- if (!jid || lstrlen(jid)==0) continue;
+ if (!jid || mir_tstrlen(jid)==0) continue;
}
Cell=xmlGetNthChild(Row,_T("Cell"),3);
@@ -1654,7 +1654,7 @@ protected:
m_cbServer.GetTextA(server, SIZEOF(server));
ptrA dbManualServer( db_get_sa(NULL, m_proto->m_szModuleName, "ManualHost"));
if (dbManualServer != NULL)
- lstrcpynA(manualServer, dbManualServer, SIZEOF(manualServer));
+ mir_strncpy(manualServer, dbManualServer, SIZEOF(manualServer));
m_canregister = true;
if (!lstrcmpA(manualServer, "talk.google.com")) {
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index e177b0897b..46ec590355 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -122,7 +122,7 @@ void CCtrlTreeOpts::OnInit()
int sectionLevel = 0;
HTREEITEM hSection = NULL;
- lstrcpy(itemName, m_options[i]->m_szOptionName);
+ mir_tstrcpy(itemName, m_options[i]->m_szOptionName);
sectionName = itemName;
while (sectionName) {
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index baccb151a1..29e88cbf68 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -945,7 +945,7 @@ BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
for (i=0; i < SIZEOF(drawItems); i++) {
SIZE sz = {0};
drawItems[i].text = TranslateTS(drawItems[i].textEng);
- GetTextExtentPoint32(lpdis->hDC, drawItems[i].text, lstrlen(drawItems[i].text), &sz);
+ GetTextExtentPoint32(lpdis->hDC, drawItems[i].text, mir_tstrlen(drawItems[i].text), &sz);
totalWidth += sz.cx + 18 + 5; // 18 pixels for icon, 5 pixel spacing
}
@@ -1049,10 +1049,10 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList)
void CJabberDlgPrivacyLists::DrawNextRulePart(HDC hdc, COLORREF color, const TCHAR *text, RECT *rc)
{
SetTextColor(hdc, color);
- DrawText(hdc, text, lstrlen(text), rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
+ DrawText(hdc, text, mir_tstrlen(text), rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
SIZE sz;
- GetTextExtentPoint32(hdc, text, lstrlen(text), &sz);
+ GetTextExtentPoint32(hdc, text, mir_tstrlen(text), &sz);
rc->left += sz.cx;
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index ca211ac890..723e73e4c1 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -843,7 +843,7 @@ int __cdecl CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt)
{
ptrA szResUtf(mir_utf8encodeT((LPCTSTR)evt->lParam));
evt->pCustomData = szResUtf;
- evt->cbCustomDataSize = lstrlenA(szResUtf);
+ evt->cbCustomDataSize = mir_strlen(szResUtf);
Proto_RecvMessage(hContact, evt);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 0946ac6b76..2ce34e50d0 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -247,7 +247,7 @@ static char *StatusModeToDbSetting(int status,const char *suffix)
case ID_STATUS_IDLE: prefix="Idl"; break;
default: return NULL;
}
- lstrcpyA(str,prefix); lstrcatA(str,suffix);
+ mir_strcpy(str,prefix); mir_strcat(str,suffix);
return str;
}
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index cc320b01c0..dad25263b6 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -47,12 +47,12 @@ struct UserInfoStringBuf
void append(TCHAR *str) {
if (!str) return;
- int length = lstrlen(str);
+ int length = mir_tstrlen(str);
if (size - offset < length + 1) {
size += (length + STRINGBUF_INCREMENT);
buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR));
}
- lstrcpy(buf + offset, str);
+ mir_tstrcpy(buf + offset, str);
offset += length;
}
@@ -65,7 +65,7 @@ struct UserInfoStringBuf
}
void actualize() {
- if (buf) offset = lstrlen(buf);
+ if (buf) offset = mir_tstrlen(buf);
}
};
@@ -177,7 +177,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon,
if (title)
mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), title, value);
else
- lstrcpyn(buf, value, SIZEOF(buf));
+ mir_tstrncpy(buf, value, SIZEOF(buf));
TVINSERTSTRUCT tvis = {0};
tvis.hParent = htiRoot;
@@ -257,14 +257,14 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
// Idle
if (r->m_dwIdleStartTime > 0) {
- lstrcpyn(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf));
- int len = lstrlen(buf);
+ mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf));
+ int len = mir_tstrlen(buf);
if (len > 0) buf[len-1] = 0;
}
else if (!r->m_dwIdleStartTime)
- lstrcpyn(buf, TranslateT("unknown"), SIZEOF(buf));
+ mir_tstrncpy(buf, TranslateT("unknown"), SIZEOF(buf));
else
- lstrcpyn(buf, TranslateT("<not specified>"), SIZEOF(buf));
+ mir_tstrncpy(buf, TranslateT("<not specified>"), SIZEOF(buf));
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE));
@@ -365,14 +365,14 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
// logoff
JABBER_RESOURCE_STATUS *r = item->getTemp();
if (r->m_dwIdleStartTime > 0) {
- lstrcpyn(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf));
- int len = lstrlen(buf);
+ mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf));
+ int len = mir_tstrlen(buf);
if (len > 0) buf[len-1] = 0;
}
else if (!r->m_dwIdleStartTime)
- lstrcpyn(buf, TranslateT("unknown"), SIZEOF(buf));
+ mir_tstrncpy(buf, TranslateT("unknown"), SIZEOF(buf));
else
- lstrcpyn(buf, TranslateT("<not specified>"), SIZEOF(buf));
+ mir_tstrncpy(buf, TranslateT("<not specified>"), SIZEOF(buf));
sttFillInfoLine(hwndTree, htiRoot, NULL,
(item->jid && _tcschr(item->jid, _T('@'))) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf,
@@ -383,9 +383,9 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
// activity
if (item->m_pLastSeenResource)
- lstrcpyn(buf, item->m_pLastSeenResource->m_tszResourceName, SIZEOF(buf));
+ mir_tstrncpy(buf, item->m_pLastSeenResource->m_tszResourceName, SIZEOF(buf));
else
- lstrcpyn(buf, TranslateT("<no information available>"), SIZEOF(buf));
+ mir_tstrncpy(buf, TranslateT("<no information available>"), SIZEOF(buf));
sttFillInfoLine(hwndTree, htiRoot, NULL, TranslateT("Last active resource"), buf,
sttInfoLineId(0, INFOLINE_LASTACTIVE));
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index f430aabe00..ced02ad99c 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -306,7 +306,7 @@ TCHAR* __stdcall JabberStrFixLines(const TCHAR *str)
if (*p == _T('\r') || *p == _T('\n'))
++add;
- TCHAR *buf = (TCHAR *)mir_alloc((lstrlen(str) + add + 1) * sizeof(TCHAR));
+ TCHAR *buf = (TCHAR *)mir_alloc((mir_tstrlen(str) + add + 1) * sizeof(TCHAR));
TCHAR *res = buf;
for (p = str; p && *p; ++p) {
@@ -986,8 +986,8 @@ const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr)
TCHAR *str_up = NEWTSTR_ALLOCA(str);
TCHAR *substr_up = NEWTSTR_ALLOCA(substr);
- CharUpperBuff(str_up, lstrlen(str_up));
- CharUpperBuff(substr_up, lstrlen(substr_up));
+ CharUpperBuff(str_up, mir_tstrlen(str_up));
+ CharUpperBuff(substr_up, mir_tstrlen(substr_up));
TCHAR *p = _tcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
@@ -1002,9 +1002,9 @@ void JabberCopyText(HWND hwnd, const TCHAR *text)
OpenClipboard(hwnd);
EmptyClipboard();
- HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(text) + 1));
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(text) + 1));
TCHAR *s = (TCHAR *)GlobalLock(hMem);
- lstrcpy(s, text);
+ mir_tstrcpy(s, text);
GlobalUnlock(hMem);
SetClipboardData(CF_UNICODETEXT, hMem);
CloseClipboard();
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index 33dc3eba4a..4ed2769df8 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -281,13 +281,13 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate)
if (!info.nodeName) return;
TCHAR *nodeName = (TCHAR *)alloca(sizeof(TCHAR) * (info.nodeName.length+1));
- lstrcpyn(nodeName, info.nodeName.p, info.nodeName.length+1);
+ mir_tstrncpy(nodeName, info.nodeName.p, info.nodeName.length+1);
if (info.attrName && info.attrValue) {
TCHAR *attrName = (TCHAR *)alloca(sizeof(TCHAR)* (info.attrName.length + 1));
- lstrcpyn(attrName, info.attrName.p, info.attrName.length + 1);
+ mir_tstrncpy(attrName, info.attrName.p, info.attrName.length + 1);
TCHAR *attrValue = (TCHAR *)alloca(sizeof(TCHAR)* (info.attrValue.length + 1));
- lstrcpyn(attrValue, info.attrValue.p, info.attrValue.length + 1);
+ mir_tstrncpy(attrValue, info.attrValue.p, info.attrValue.length + 1);
HXML hXml = xmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName) << XATTR(attrName, attrValue));
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 20b4175b2a..fe209b5ef8 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -343,16 +343,16 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
break;
}
}
- else lstrcpyn(text, mode->m_title, SIZEOF(text));
+ else mir_tstrncpy(text, mode->m_title, SIZEOF(text));
DrawIconEx(lpdis->hDC, lpdis->rcItem.left+2, (lpdis->rcItem.top+lpdis->rcItem.bottom-16)/2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top+lpdis->rcItem.bottom-tm.tmHeight)/2, text, lstrlen(text));
+ TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top+lpdis->rcItem.bottom-tm.tmHeight)/2, text, mir_tstrlen(text));
}
else {
TCHAR text[128];
mir_sntprintf(text, SIZEOF(text), _T("...%s"), mode->m_title);
DrawIconEx(lpdis->hDC, lpdis->rcItem.left+23, (lpdis->rcItem.top+lpdis->rcItem.bottom-16)/2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top+lpdis->rcItem.bottom-tm.tmHeight)/2, text, lstrlen(text));
+ TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top+lpdis->rcItem.bottom-tm.tmHeight)/2, text, mir_tstrlen(text));
}
return TRUE;
@@ -702,7 +702,7 @@ void CPepMood::SetMood(MCONTACT hContact, const TCHAR *szMood, const TCHAR *szTe
m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/mood", g_MoodIcons.GetIcolibHandle(g_arrMoods[mood].szTag), TranslateTS(g_arrMoods[mood].szName));
}
else {
- lstrcpy(title, LPGENT("Set mood..."));
+ mir_tstrcpy(title, LPGENT("Set mood..."));
m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/mood", LoadSkinnedIconHandle(SKINICON_OTHER_SMALLDOT), TranslateT("Set mood..."));
}
}
@@ -974,7 +974,7 @@ void ActivityBuildTitle(int id, TCHAR *buf, int size)
if (szSecond)
mir_sntprintf(buf, size, _T("%s [%s]"), TranslateTS(szFirst), TranslateTS(szSecond));
else
- lstrcpyn(buf, TranslateTS(szFirst), size);
+ mir_tstrncpy(buf, TranslateTS(szFirst), size);
}
else *buf = 0;
}
@@ -1088,7 +1088,7 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec
m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", g_ActivityIcons.GetIcolibHandle(returnActivity(activity)), activityTitle);
}
else {
- lstrcpy(title, LPGENT("Set activity..."));
+ mir_tstrcpy(title, LPGENT("Set activity..."));
m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", LoadSkinnedIconHandle(SKINICON_OTHER_SMALLDOT), TranslateT("Set activity..."));
}
}
@@ -1354,9 +1354,9 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam)
return 1;
if (pData->flags & CSSF_UNICODE)
- lstrcpynW(pData->pwszName, g_arrMoods[dwXStatus].szName, (STATUS_TITLE_MAX + 1));
+ mir_wstrncpy(pData->pwszName, g_arrMoods[dwXStatus].szName, (STATUS_TITLE_MAX + 1));
else {
- size_t dwStatusTitleSize = lstrlenW(g_arrMoods[dwXStatus].szName);
+ size_t dwStatusTitleSize = mir_wstrlen(g_arrMoods[dwXStatus].szName);
if (dwStatusTitleSize > STATUS_TITLE_MAX)
dwStatusTitleSize = STATUS_TITLE_MAX;
diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp
index 56db0d4827..696986e637 100644
--- a/protocols/JabberG/src/ui_utils.cpp
+++ b/protocols/JabberG/src/ui_utils.cpp
@@ -299,7 +299,7 @@ TCHAR* CCtrlCombo::GetItemText(int index, TCHAR *buf, int size)
{
TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
- lstrcpyn(buf, result, size);
+ mir_tstrncpy(buf, result, size);
return buf;
}
@@ -386,7 +386,7 @@ TCHAR* CCtrlListBox::GetItemText(int index, TCHAR *buf, int size)
{
TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
- lstrcpyn(buf, result, size);
+ mir_tstrncpy(buf, result, size);
return buf;
}
@@ -853,7 +853,7 @@ void CCtrlListView::AddGroup(int iGroupId, TCHAR *name)
lvg.cbSize = sizeof(lvg);
lvg.mask = LVGF_HEADER | LVGF_GROUPID;
lvg.pszHeader = name;
- lvg.cchHeader = lstrlen(lvg.pszHeader);
+ lvg.cchHeader = mir_tstrlen(lvg.pszHeader);
lvg.iGroupId = iGroupId;
InsertGroup(-1, &lvg);
}
@@ -2316,7 +2316,7 @@ void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText)
if (szText) {
curText = szText;
- curLength = lstrlen(curText);
+ curLength = mir_tstrlen(curText);
}
else {
curLength = GetWindowTextLength(m_hwnd) + 1;
@@ -2326,7 +2326,7 @@ void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText)
}
if (!_tcsstr(curText, m_proto_interface->m_tszUserName)) {
- int length = curLength + lstrlen(m_proto_interface->m_tszUserName) + 256;
+ int length = curLength + mir_tstrlen(m_proto_interface->m_tszUserName) + 256;
TCHAR *text = (TCHAR *)_alloca(length * sizeof(TCHAR));
mir_sntprintf(text, length, _T("%s [%s: %s]"), curText, TranslateT("Account"), m_proto_interface->m_tszUserName);
SetWindowText(m_hwnd, text);
@@ -2339,7 +2339,7 @@ void CProtoIntDlgBase::UpdateStatusBar()
HDC hdc = GetDC(m_hwndStatus);
HFONT hFntSave = (HFONT)SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
- GetTextExtentPoint32(hdc, m_proto_interface->m_tszUserName, lstrlen(m_proto_interface->m_tszUserName), &sz);
+ GetTextExtentPoint32(hdc, m_proto_interface->m_tszUserName, mir_tstrlen(m_proto_interface->m_tszUserName), &sz);
sz.cx += GetSystemMetrics(SM_CXSMICON) * 3;
SelectObject(hdc, hFntSave);
ReleaseDC(m_hwndStatus, hdc);
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index 440ba67102..0ddab4b217 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -332,7 +332,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
pai.hContact = pmraaqiAvatarsQueueItem->hContact;
pai.format = dwAvatarFormat;
if (db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH))
- lstrcpyn(pai.filename, wszFileName, SIZEOF(pai.filename));
+ mir_tstrncpy(pai.filename, wszFileName, SIZEOF(pai.filename));
else
PathToRelativeT(wszFileName, pai.filename);
@@ -551,7 +551,7 @@ DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFl
// ôàéë ñ àâàòàðîì ñóùåñòâóåò è íå óñòàðåë/íå áûëî êîììàíäû îáíîâëÿòü(ïðîñòî çàïðîñ èìåíè)
if (lpszPath) {
if (db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH))
- lstrcpyn(lpszPath, wszFileName, MAX_PATH);
+ mir_tstrncpy(lpszPath, wszFileName, MAX_PATH);
else
PathToRelativeT(wszFileName, lpszPath);
}
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index 69be898335..3dd6251320 100644
--- a/protocols/MRA/src/MraChat.cpp
+++ b/protocols/MRA/src/MraChat.cpp
@@ -192,8 +192,8 @@ int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam)
if (!_stricmp(gch->pDest->pszModule, m_szModuleName)) {
switch (gch->pDest->iType) {
case GC_USER_MESSAGE:
- if (gch->ptszText && lstrlen(gch->ptszText)) {
- size_t dwMessageSize = lstrlenW(gch->ptszText);
+ if (gch->ptszText && mir_tstrlen(gch->ptszText)) {
+ size_t dwMessageSize = mir_wstrlen(gch->ptszText);
CMStringA szEmail = gch->pDest->ptszID;
MCONTACT hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
BOOL bSlowSend = getByte("SlowSend", MRA_DEFAULT_SLOW_SEND);
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index eaca08cc52..10b0678a9b 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -662,7 +662,7 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags
MRA_FILES_QUEUE_FILE &p = dat->pmfqfFiles[dat->dwFilesCount];
p.lpwszName = mir_wstrdup(wszCurrFile);
- p.dwNameLen = lstrlen(p.lpwszName);
+ p.dwNameLen = mir_tstrlen(p.lpwszName);
p.dwSize = _wtoi(wszCurrSize);
dat->dwFilesTotalSize += p.dwSize;
dwFileNameTotalSize += p.dwNameLen * sizeof(TCHAR);
@@ -946,7 +946,7 @@ DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, M
}
else p.dwSize = 0;
- p.dwNameLen = lstrlenW(plpwszFiles[i]);
+ p.dwNameLen = mir_wstrlen(plpwszFiles[i]);
p.lpwszName = mir_wstrdup(plpwszFiles[i]);
}
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp
index a36c6f9d35..0b6c61130d 100644
--- a/protocols/MRA/src/MraIcons.cpp
+++ b/protocols/MRA/src/MraIcons.cpp
@@ -79,7 +79,7 @@ void InitXStatusIcons()
LPWSTR lpwszFileName;
g_dwMirWorkDirPathLen = GetFullPathName(szBuff, MAX_FILEPATH, g_szMirWorkDirPath, &lpwszFileName);
if (g_dwMirWorkDirPathLen) {
- g_dwMirWorkDirPathLen -= lstrlenW(lpwszFileName);
+ g_dwMirWorkDirPathLen -= mir_wstrlen(lpwszFileName);
g_szMirWorkDirPath[g_dwMirWorkDirPathLen] = 0;
// load xstatus icons lib
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp
index 87bac3d0a1..805cd75e62 100644
--- a/protocols/MRA/src/MraPopUp.cpp
+++ b/protocols/MRA/src/MraPopUp.cpp
@@ -256,9 +256,9 @@ void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LP
ppd.lchContact = hContact;
if (lpszTitle)
- lstrcpyn(ppd.lptzContactName, lpszTitle, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzContactName, lpszTitle, MAX_CONTACTNAME);
if (lpszMessage)
- lstrcpyn(ppd.lptzText, lpszMessage, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzText, lpszMessage, MAX_SECONDLINE);
ppd.PluginWindowProc = MraPopupDlgProc;
ppd.PluginData = dat;
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index 6ddfb6704c..97324fdd53 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -205,9 +205,9 @@ int CMraProto::Authorize(HANDLE hDBEvent)
if (strcmp(dbei.szModule, m_szModuleName)) return 1;
LPSTR lpszNick = (LPSTR)(dbei.pBlob + sizeof(DWORD) * 2);
- LPSTR lpszFirstName = lpszNick + lstrlenA(lpszNick) + 1;
- LPSTR lpszLastName = lpszFirstName + lstrlenA(lpszFirstName) + 1;
- MraAuthorize(CMStringA(lpszLastName + lstrlenA(lpszLastName) + 1));
+ LPSTR lpszFirstName = lpszNick + mir_strlen(lpszNick) + 1;
+ LPSTR lpszLastName = lpszFirstName + mir_strlen(lpszFirstName) + 1;
+ MraAuthorize(CMStringA(lpszLastName + mir_strlen(lpszLastName) + 1));
return 0;
}
@@ -225,9 +225,9 @@ int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason)
if (strcmp(dbei.szModule, m_szModuleName)) return 1;
LPSTR lpszNick = (LPSTR)(dbei.pBlob + sizeof(DWORD) * 2);
- LPSTR lpszFirstName = lpszNick + lstrlenA(lpszNick) + 1;
- LPSTR lpszLastName = lpszFirstName + lstrlenA(lpszFirstName) + 1;
- LPSTR szEmail = lpszLastName + lstrlenA(lpszLastName) + 1;
+ LPSTR lpszFirstName = lpszNick + mir_strlen(lpszNick) + 1;
+ LPSTR lpszLastName = lpszFirstName + mir_strlen(lpszFirstName) + 1;
+ LPSTR szEmail = lpszLastName + mir_strlen(lpszLastName) + 1;
MraMessage(FALSE, NULL, 0, 0, szEmail, szReason, NULL, 0);
return 0;
@@ -249,7 +249,7 @@ int CMraProto::AuthRequest(MCONTACT hContact, const TCHAR *lptszMessage)
HANDLE CMraProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath)
{
if (szPath != NULL)
- if (MraFilesQueueAccept(hFilesQueueHandle, (DWORD)hTransfer, szPath, lstrlen(szPath)) == NO_ERROR)
+ if (MraFilesQueueAccept(hFilesQueueHandle, (DWORD)hTransfer, szPath, mir_tstrlen(szPath)) == NO_ERROR)
return hTransfer; // Success
return NULL;
@@ -421,7 +421,7 @@ int CMraProto::SendMsg(MCONTACT hContact, int flags, const char *lpszMessage)
int iRet = 0;
if (flags & PREF_UNICODE)
- lpwszMessage = (LPWSTR)(lpszMessage + lstrlenA(lpszMessage) + 1);
+ lpwszMessage = (LPWSTR)(lpszMessage + mir_strlen(lpszMessage) + 1);
else if (flags & PREF_UTF)
lpwszMessage = mir_utf8decodeT(lpszMessage);
else
@@ -576,7 +576,7 @@ int CMraProto::SetAwayMsg(int m_iStatus, const TCHAR* msg)
if (!m_bLoggedIn)
return 1;
- size_t dwStatusDescSize = lstrlen(msg);
+ size_t dwStatusDescSize = mir_tstrlen(msg);
DWORD dwStatus = m_iStatus;
DWORD dwXStatus = m_iXStatus;
diff --git a/protocols/MRA/src/MraRTFMsg.cpp b/protocols/MRA/src/MraRTFMsg.cpp
index 03401631c6..89e21c867a 100644
--- a/protocols/MRA/src/MraRTFMsg.cpp
+++ b/protocols/MRA/src/MraRTFMsg.cpp
@@ -210,7 +210,7 @@ DWORD CMraProto::MraConvertToRTFW(const CMStringW &wszMessage, CMStringA &szMess
HDC hDC = GetDC(NULL);// kegl
lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
- lstrcpyn(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
+ mir_tstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
ReleaseDC(NULL, hDC);
}
dwFontSize = ((-lf.lfHeight)+(((-lf.lfHeight)+4)/8));
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp
index 220d9a2c96..b25fb0033c 100644
--- a/protocols/MRA/src/MraSendCommand.cpp
+++ b/protocols/MRA/src/MraSendCommand.cpp
@@ -110,7 +110,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType
DWORD dwRTFDataSize = buf.Len();
if ( compress2((LPBYTE)lpbRTFData, &dwRTFDataSize, buf.Data(), buf.Len(), Z_BEST_COMPRESSION) == Z_OK) {
lpszMessageRTF = mir_base64_encode((LPBYTE)lpbRTFData, dwRTFDataSize);
- dwMessageRTFSize = lstrlenA(lpszMessageRTF);
+ dwMessageRTFSize = mir_strlen(lpszMessageRTF);
}
}
// standart message
@@ -130,7 +130,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType
DWORD dwRTFDataSize = lpbRTFData.GetLength();
if ( compress2((LPBYTE)(LPCSTR)lpbRTFData, &dwRTFDataSize, buf.Data(), buf.Len(), Z_BEST_COMPRESSION) == Z_OK) {
lpszMessageRTF = mir_base64_encode((LPBYTE)(LPCSTR)lpbRTFData, dwRTFDataSize);
- dwMessageRTFSize = lstrlenA(lpszMessageRTF);
+ dwMessageRTFSize = mir_strlen(lpszMessageRTF);
}
}
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index a9af00ed8c..0a460c7cf2 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -215,7 +215,7 @@ bool DB_GetStaticStringW(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN
size_t dwReadedStringLen;
DBVARIANT dbv = { 0 };
if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) {
- dwReadedStringLen = lstrlenW(dbv.pwszVal);
+ dwReadedStringLen = mir_wstrlen(dbv.pwszVal);
if (lpwszRetBuff && (dwRetBuffSize > dwReadedStringLen)) {
memmove(lpwszRetBuff, dbv.pszVal, (dwReadedStringLen*sizeof(WCHAR)));//include null terminated
(*((WCHAR*)(lpwszRetBuff + dwReadedStringLen))) = 0;
@@ -641,8 +641,8 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
if (m_dwEmailMessagesUnread) {
CMStringA szEmail;
MCONTACT hContact = NULL;
- TCHAR szMailBoxStatus[MAX_SECONDLINE];
+ TCHAR szMailBoxStatus[MAX_SECONDLINE];
mir_sntprintf(szMailBoxStatus, SIZEOF(szMailBoxStatus), TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
if (!pszFrom.IsEmpty() || !pszSubject.IsEmpty()) {
@@ -652,7 +652,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
}
- else lstrcpyn(szStatusText, szMailBoxStatus, SIZEOF(szStatusText));
+ else _tcsncpy_s(szStatusText, szMailBoxStatus, _TRUNCATE);
if (bTrayIconNewMailNotify) {
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
@@ -763,7 +763,7 @@ bool IsEMailMR(const CMStringA &szEmail)
{
if (szEmail) {
for (int i = 0; lpcszMailRuDomains[i]; i++) {
- int dwDomainLen = lstrlenA(lpcszMailRuDomains[i]);
+ int dwDomainLen = mir_strlen(lpcszMailRuDomains[i]);
if (dwDomainLen < szEmail.GetLength())
if (!_stricmp(lpcszMailRuDomains[i], szEmail.c_str() + szEmail.GetLength() - dwDomainLen))
if (szEmail[szEmail.GetLength() - dwDomainLen - 1] == '@')
@@ -1050,8 +1050,8 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP
dwBuffSize = GetDlgItemText(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX + 1));
if (dwBuffSize == 0) { // user delete all text
- lstrcpyn(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), (STATUS_TITLE_MAX + 1));
- dwBuffSize = lstrlenW(szBuff);
+ mir_tstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1);
+ dwBuffSize = mir_wstrlen(szBuff);
}
mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%dName", dat->dwXStatus);
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
@@ -1231,8 +1231,8 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD
DWORD dwPathLen, dwRecDeepAllocated, dwRecDeepCurPos, dwFilePathLen;
RECURSION_DATA_STACK_ITEM *prdsiItems;
- if (dwFolderLen == -1) dwFolderLen = lstrlenW(lpszFolder);
- if (dwFileNameLen == -1) dwFileNameLen = lstrlenW(lpszFileName);
+ if (dwFolderLen == -1) dwFolderLen = mir_wstrlen(lpszFolder);
+ if (dwFileNameLen == -1) dwFileNameLen = mir_wstrlen(lpszFileName);
dwRecDeepCurPos = 0;
dwRecDeepAllocated = RECURSION_DATA_STACK_ITEMS_MIN;
@@ -1245,7 +1245,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD
dwPathLen++;
}
szPath[dwPathLen] = 0;
- lstrcat(szPath, _T("*.*"));
+ mir_tstrcat(szPath, _T("*.*"));
prdsiItems[dwRecDeepCurPos].dwFileNameLen = 0;
prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, NULL, 0);
@@ -1258,9 +1258,9 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD
if (prdsiItems[dwRecDeepCurPos].w32fdFindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {// folder
if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, _T("."), 1) != CSTR_EQUAL)
if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, _T(".."), 2) != CSTR_EQUAL) {
- prdsiItems[dwRecDeepCurPos].dwFileNameLen = (lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName) + 1);
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen = (mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName) + 1);
memmove((szPath + dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, (prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR)));
- lstrcat(szPath, _T("\\*.*"));
+ mir_tstrcat(szPath, _T("\\*.*"));
dwPathLen += prdsiItems[dwRecDeepCurPos].dwFileNameLen;
dwRecDeepCurPos++;
@@ -1278,7 +1278,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD
}
else {// file
if (CompareString(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, lpszFileName, dwFileNameLen) == CSTR_EQUAL) {
- prdsiItems[dwRecDeepCurPos].dwFileNameLen = lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName);
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen = mir_wstrlen(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName);
memmove((szPath + dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, ((prdsiItems[dwRecDeepCurPos].dwFileNameLen + 1)*sizeof(WCHAR)));
dwFilePathLen = (dwPathLen + prdsiItems[dwRecDeepCurPos].dwFileNameLen);
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp
index 9498b1ceca..fa15c971d3 100644
--- a/protocols/MRA/src/Mra_options.cpp
+++ b/protocols/MRA/src/Mra_options.cpp
@@ -168,7 +168,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L
HDC hDC = GetDC(NULL);// kegl
lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
- lstrcpyn(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
+ mir_tstrncpy(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
ReleaseDC(NULL, hDC);
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp
index 28d8d05590..f114c956fe 100644
--- a/protocols/MRA/src/Mra_svcs.cpp
+++ b/protocols/MRA/src/Mra_svcs.cpp
@@ -466,9 +466,9 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam)
return 1;
if (pData->flags & CSSF_UNICODE)
- lstrcpyn(pData->ptszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX + 1));
+ mir_tstrncpy(pData->ptszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX + 1));
else {
- size_t dwStatusTitleSize = lstrlen(lpcszXStatusNameDef[dwXStatus]);
+ size_t dwStatusTitleSize = mir_tstrlen(lpcszXStatusNameDef[dwXStatus]);
if (dwStatusTitleSize > STATUS_TITLE_MAX)
dwStatusTitleSize = STATUS_TITLE_MAX;
@@ -631,7 +631,7 @@ INT_PTR CMraProto::MraGetMyAvatar(WPARAM wParam, LPARAM lParam)
{
CMStringW wszFileName;
if (MraAvatarsGetFileName(hAvatarsQueueHandle, NULL, GetContactAvatarFormat(NULL, PA_FORMAT_DEFAULT), wszFileName) == NO_ERROR) {
- lstrcpyn((LPTSTR)wParam, wszFileName, (size_t)lParam);
+ mir_tstrncpy((LPTSTR)wParam, wszFileName, (size_t)lParam);
return 0;
}
return 1;
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index c3bfaf9ee6..4c5b24369e 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -292,7 +292,7 @@ void CMsnProto::MSN_CustomSmiley(const char* msgBody, char* email, char* nick, i
size_t slen = strlen(lastsml);
ptrA buf(mir_base64_encode((PBYTE)lastsml, (unsigned)slen));
ptrA smileyName(mir_urlEncode(buf));
- int rlen = lstrlenA(buf);
+ int rlen = mir_strlen(buf);
TCHAR path[MAX_PATH];
MSN_GetCustomSmileyFileName(hContact, path, SIZEOF(path), smileyName, iSmileyType);
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index ffe25feeb1..f9703ad446 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -2129,7 +2129,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid)
ft->p2p_sessionid = MSN_GenRandom();
ptrA szContextEnc(mir_base64_encode((PBYTE)pContext, (unsigned)cbContext));
- int cbContextEnc = lstrlenA(szContextEnc);
+ int cbContextEnc = mir_strlen(szContextEnc);
MimeHeaders chdrs(10);
chdrs.addString("EUF-GUID", szAppID);
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp
index 52d08a6a45..8fc3c11d8e 100644
--- a/protocols/SkypeClassic/src/skype.cpp
+++ b/protocols/SkypeClassic/src/skype.cpp
@@ -214,12 +214,12 @@ int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) {
MessagePopup.iSeconds = popupTimeSec;
MessagePopup.PluginData = (void *)1;
- lstrcpy(MessagePopup.lptzText, lpzText);
+ mir_tstrcpy(MessagePopup.lptzText, lpzText);
#ifdef _UNICODE
mbstowcs(MessagePopup.lptzContactName, SKYPE_PROTONAME, strlen(SKYPE_PROTONAME) + 1);
#else
- lstrcpy(MessagePopup.lptzContactName, SKYPE_PROTONAME);
+ mir_tstrcpy(MessagePopup.lptzContactName, SKYPE_PROTONAME);
#endif
if (showPopup)
@@ -1548,9 +1548,9 @@ void RingThread(char *szSkypeMsg) {
InCallPopup.PluginWindowProc = InCallPopUpProc;
InCallPopup.PluginData = (void *)1;
- lstrcpyn(InCallPopup.lptzText, TranslateT("Incoming Skype Call"), MAX_SECONDLINE);
+ mir_tstrncpy(InCallPopup.lptzText, TranslateT("Incoming Skype Call"), MAX_SECONDLINE);
- lstrcpyn(InCallPopup.lptzContactName, lpzContactName, MAX_CONTACTNAME);
+ mir_tstrncpy(InCallPopup.lptzContactName, lpzContactName, MAX_CONTACTNAME);
if (showPopup)
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&InCallPopup, 0);
@@ -2477,7 +2477,7 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
if (!db_get_s(NULL, SKYPE_PROTONAME, "AvatarFile", &dbv))
{
- lstrcpynA(AI->filename, dbv.pszVal, sizeof(AI->filename));
+ mir_strncpy(AI->filename, dbv.pszVal, sizeof(AI->filename));
db_free(&dbv);
return GAIR_SUCCESS;
}
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp
index f260107b2c..3caea3d09f 100644
--- a/protocols/SkypeClassic/src/skypeopt.cpp
+++ b/protocols/SkypeClassic/src/skypeopt.cpp
@@ -169,9 +169,9 @@ INT_PTR CALLBACK OptPopupDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
InCallPopup.iSeconds = popupTimeSec;
InCallPopup.PluginData = (void *)1;
- lstrcpy(InCallPopup.lptzText, TranslateT("Incoming Skype Call"));
+ mir_tstrcpy(InCallPopup.lptzText, TranslateT("Incoming Skype Call"));
- lstrcpy(InCallPopup.lptzContactName, lpzContactName);
+ mir_tstrcpy(InCallPopup.lptzContactName, lpzContactName);
CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&InCallPopup,0);
@@ -186,9 +186,9 @@ INT_PTR CALLBACK OptPopupDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
ErrorPopup.iSeconds = popupTimeSecErr;
ErrorPopup.PluginData = (void *)1;
- lstrcpy(ErrorPopup.lptzText, TranslateT("Preview Error Message"));
+ mir_tstrcpy(ErrorPopup.lptzText, TranslateT("Preview Error Message"));
- lstrcpy(ErrorPopup.lptzContactName, _T("Error Message"));
+ mir_tstrcpy(ErrorPopup.lptzContactName, _T("Error Message"));
CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&ErrorPopup,0);
diff --git a/protocols/SkypeClassic/src/skypesvc.cpp b/protocols/SkypeClassic/src/skypesvc.cpp
index b7ed84be4d..e5b1dc2c8e 100644
--- a/protocols/SkypeClassic/src/skypesvc.cpp
+++ b/protocols/SkypeClassic/src/skypesvc.cpp
@@ -168,7 +168,7 @@ INT_PTR SkypeGetAvatar(WPARAM wParam,LPARAM lParam)
{
DBVARIANT dbv;
if (!db_get_s(NULL,SKYPE_PROTONAME, "AvatarFile", &dbv)){
- lstrcpynA((char*)wParam, dbv.pszVal, (int)lParam);
+ mir_strncpy((char*)wParam, dbv.pszVal, (int)lParam);
db_free(&dbv);
}
return 0;
diff --git a/protocols/SkypeClassic/src/utf8.cpp b/protocols/SkypeClassic/src/utf8.cpp
index 8ae746e871..32a77231b3 100644
--- a/protocols/SkypeClassic/src/utf8.cpp
+++ b/protocols/SkypeClassic/src/utf8.cpp
@@ -287,7 +287,7 @@ static int convert_string(const char *fromcode, const char *tocode,
size_t fromlen;
char *s;
- fromlen = lstrlen(from);
+ fromlen = mir_tstrlen(from);
ret = convert_buffer(fromcode, tocode, from, fromlen, to, 0);
if (ret == -2)
return -1;
@@ -297,7 +297,7 @@ static int convert_string(const char *fromcode, const char *tocode,
s = malloc(fromlen + 1);
if (!s)
return -1;
- lstrcpy(s, from);
+ mir_tstrcpy(s, from);
*to = s;
for (; *s; s++)
if (*s & ~0x7f)
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index 83f5982c81..b2e333978f 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -228,7 +228,7 @@ INT_PTR TwitterProto::SvcCreateAccMgrUI(WPARAM,LPARAM lParam)
INT_PTR TwitterProto::GetName(WPARAM wParam,LPARAM lParam)
{
- lstrcpynA(reinterpret_cast<char*>(lParam), m_szModuleName, (int)wParam);
+ mir_strncpy(reinterpret_cast<char*>(lParam), m_szModuleName, (int)wParam);
return 0;
}
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 79762394ca..f55c97edde 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -359,7 +359,7 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam)
switch (gch->pDest->iType) {
case GC_USER_MESSAGE:
- if (IsOnline() && lstrlen(gch->ptszText) > 0) {
+ if (IsOnline() && mir_tstrlen(gch->ptszText) > 0) {
TCHAR *buf = NEWTSTR_ALLOCA(gch->ptszText);
rtrimt(buf);
UnEscapeChatTags(buf);
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index ad6f2f9d92..59e43defdd 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -361,8 +361,8 @@ void WhatsAppProto::NotifyEvent(const TCHAR *title, const TCHAR *info, MCONTACT
pd.lchIcon = Skin_GetIconByHandle(m_hProtoIcon); // TODO: Icon test
pd.PluginData = szUrl;
pd.PluginWindowProc = (WNDPROC)PopupDlgProc;
- lstrcpy(pd.lptzContactName, title);
- lstrcpy(pd.lptzText, info);
+ mir_tstrcpy(pd.lptzContactName, title);
+ mir_tstrcpy(pd.lptzText, info);
ret = PUAddPopupT(&pd);
if (ret == 0)
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp
index df4a9686e3..92b3599b51 100644
--- a/protocols/Xfire/src/main.cpp
+++ b/protocols/Xfire/src/main.cpp
@@ -1410,7 +1410,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM lParam)
//=======================================================
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- lstrcpynA((char*)lParam, "XFire", wParam);
+ mir_strncpy((char*)lParam, "XFire", wParam);
return 0;
}
@@ -1802,7 +1802,7 @@ void SetAvatar(LPVOID lparam)
AI.cbSize = sizeof(AI);
AI.format = av.type;
AI.hContact = xsa->hContact;
- lstrcpy(AI.filename, _A2T(av.file));
+ mir_tstrcpy(AI.filename, _A2T(av.file));
ProtoBroadcastAck(protocolname, xsa->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&AI, 0);
}
@@ -3048,7 +3048,7 @@ INT_PTR BasicSearch(WPARAM wParam, LPARAM lParam) {
if (myClient != NULL)
if (myClient->client->connected)
{
- lstrcpynA(buf, (const char *)lParam, 50);
+ mir_strncpy(buf, (const char *)lParam, 50);
mir_forkthread(AckBasicSearch, &buf);
return 1;
}
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp
index e3daffe50d..f7ee82d0ad 100644
--- a/protocols/Xfire/src/options.cpp
+++ b/protocols/Xfire/src/options.cpp
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
db_free(&dbv);
//den login lowercasen
- int size = lstrlenA(login);
+ int size = mir_strlen(login);
BOOL mustlowercase = FALSE;
for (int i = 0; i < size; i++)
{
diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp
index 68a5994d34..4d92a63f51 100644
--- a/protocols/Xfire/src/processbuddyinfo.cpp
+++ b/protocols/Xfire/src/processbuddyinfo.cpp
@@ -94,7 +94,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c
AI.cbSize = sizeof(AI);
AI.format = type;
AI.hContact = hcontact;
- lstrcpy(AI.filename, _A2T(filename));
+ mir_tstrcpy(AI.filename, _A2T(filename));
ProtoBroadcastAck(protocolname, hcontact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&AI, 0);
}
else //eigenen avatar setzen
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp
index 42d8299505..5c42c159b1 100644
--- a/protocols/Xfire/src/tools.cpp
+++ b/protocols/Xfire/src/tools.cpp
@@ -100,8 +100,8 @@ int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, HICON h
bIconsNotLoaded = FALSE;
}
- lstrcpyn(ppd.lptzContactName, _A2T(lpCaption), SIZEOF(ppd.lptzContactName));
- lstrcpyn(ppd.lptzText, _A2T(lpText), SIZEOF(ppd.lptzText));
+ mir_tstrncpy(ppd.lptzContactName, _A2T(lpCaption), SIZEOF(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzText, _A2T(lpText), SIZEOF(ppd.lptzText));
if ((uType & MB_ICONMASK) == MB_ICONSTOP) {
ppd.lchIcon = hicError;
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp
index 5e2f99ceca..1acdb1fe5f 100644
--- a/protocols/Yahoo/src/avatar.cpp
+++ b/protocols/Yahoo/src/avatar.cpp
@@ -764,7 +764,7 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
if (getDword("AvatarHash", 0)) {
if (!getTString("AvatarFile", &dbv)) {
if (_taccess(dbv.ptszVal, 0) == 0) {
- lstrcpyn(buffer, dbv.ptszVal, size-1);
+ mir_tstrncpy(buffer, dbv.ptszVal, size-1);
buffer[size-1] = '\0';
ret = 0;
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp
index 9d477785de..1cfe32740f 100644
--- a/protocols/Yahoo/src/file_transfer.cpp
+++ b/protocols/Yahoo/src/file_transfer.cpp
@@ -486,7 +486,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url,
ZeroMemory(fn, 1024);
if (fname != NULL)
- lstrcpynA(fn, fname, 1024);
+ mir_strncpy(fn, fname, 1024);
else {
char *start, *end;
@@ -498,9 +498,9 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url,
end = ( char* )strrchr(url, '?');
if (start && *start && end) {
- lstrcpynA(fn, start, end-start+1);
+ mir_strncpy(fn, start, end-start+1);
} else
- lstrcpyA(fn, "filename.ext");
+ mir_strcpy(fn, "filename.ext");
}
yahoo_file_info *fi = y_new(struct yahoo_file_info,1);
@@ -557,7 +557,7 @@ void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_
struct yahoo_file_info *fi = (struct yahoo_file_info *) f->data;
mir_snprintf(z, 1024, "%s (%lu)\r\n", fi->filename, fi->filesize);
- lstrcatA(fn, z);
+ mir_strcat(fn, z);
fc++;
}
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp
index 31e47510ec..03f45a3f37 100644
--- a/protocols/Yahoo/src/im.cpp
+++ b/protocols/Yahoo/src/im.cpp
@@ -1,9 +1,9 @@
/*
* $Id: im.cpp 12307 2010-08-11 21:49:46Z Michael.Kunz@s2005.TU-Chemnitz.de $
*
- * myYahoo Miranda Plugin
+ * myYahoo Miranda Plugin
*
- * Authors: Gennady Feldman (aka Gena01)
+ * Authors: Gennady Feldman (aka Gena01)
* Laurent Marechal (aka Peorth)
*
* This code is under GPL and is based on AIM, MSN and Miranda source code.
@@ -22,20 +22,20 @@
void CYahooProto::send_msg(const char *id, int protocol, const char *msg, int utf8)
{
LOG(("[send_msg] Who: %s: protocol: %d Msg: '%s', utf: %d", id, protocol, msg, utf8));
-
+
int buddy_icon = (getDword("AvatarHash", 0) != 0) ? 2: 0;
yahoo_send_im(m_id, NULL, id, protocol, msg, utf8, buddy_icon);
}
-void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, const char *msg,
- long tm, int stat, int utf8, int buddy_icon,
+void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, const char *msg,
+ long tm, int stat, int utf8, int buddy_icon,
const char *seqn, int sendn)
{
char *umsg;
const char *c = msg;
int oidx = 0;
- LOG(("YAHOO_GOT_IM id:%s %s: %s (len: %d) tm:%lu stat:%i utf8:%i buddy_icon: %i", me, who, msg, lstrlenA(msg), tm, stat, utf8, buddy_icon));
+ LOG(("YAHOO_GOT_IM id:%s %s: %s (len: %d) tm:%lu stat:%i utf8:%i buddy_icon: %i", me, who, msg, mir_strlen(msg), tm, stat, utf8, buddy_icon));
if (stat == 2) {
char z[1024];
@@ -68,7 +68,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
}
// make a bigger buffer for \n -> \r\n conversion (x2)
- umsg = (char *) alloca(lstrlenA(msg) * 2 + 1);
+ umsg = (char *) alloca(mir_strlen(msg) * 2 + 1);
while ( *c != '\0') {
// Strip the font tag
@@ -76,19 +76,19 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
// strip the fade tag
!_strnicmp(c, "<FADE ",6) || !_strnicmp(c,"</FADE>",7) ||
// strip the alternate colors tag
- !_strnicmp(c, "<ALT ",5) || !_strnicmp(c, "</ALT>",6)) {
- while ((*c++ != '>') && (*c != '\0'));
+ !_strnicmp(c, "<ALT ",5) || !_strnicmp(c, "</ALT>",6)) {
+ while ((*c++ != '>') && (*c != '\0'));
} else
// strip ANSI color combination
- if ((*c == 0x1b) && (*(c+1) == '[')) {
- while ((*c++ != 'm') && (*c != '\0'));
+ if ((*c == 0x1b) && (*(c+1) == '[')) {
+ while ((*c++ != 'm') && (*c != '\0'));
} else
if (*c != '\0') {
umsg[oidx++] = *c;
/* Adding \r to \r\n conversion */
- if (*c == '\r' && *(c + 1) != '\n')
+ if (*c == '\r' && *(c + 1) != '\n')
umsg[oidx++] = '\n';
c++;
@@ -115,16 +115,16 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
DBEVENTINFO dbei = { sizeof (dbei) };
dbei.pBlob = (BYTE*)&dummy;
dbei.cbBlob = 2;
- if (!db_event_get(hEvent, &dbei))
+ if (!db_event_get(hEvent, &dbei))
// got that event, if newer than ts then reset to current time
if ((DWORD)tm < dbei.timestamp) tm = (long)time(NULL);
}
pre.timestamp = (DWORD)time(NULL);
-
+
if ((DWORD)tm < pre.timestamp)
pre.timestamp = tm;
-
+
}
else pre.timestamp = (DWORD)time(NULL);
@@ -146,7 +146,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
if (buddy_icon != 2)
reset_avatar(hContact);
else if (getDword(hContact, "PictCK", 0) == 0) /* request the buddy image */
- request_avatar(who);
+ request_avatar(who);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -180,13 +180,13 @@ int __cdecl CYahooProto::SendMsg(MCONTACT hContact, int flags, const char* pszSr
ptrA msg;
if (flags & PREF_UNICODE) /* convert to utf8 */
- msg = mir_utf8encodeW((wchar_t*)&pszSrc[strlen(pszSrc) + 1]);
+ msg = mir_utf8encodeW((wchar_t*)&pszSrc[mir_strlen(pszSrc) + 1]);
else if (flags & PREF_UTF)
msg = mir_strdup(pszSrc);
else
msg = mir_utf8encode(pszSrc);
- if (lstrlenA(msg) > 800) {
+ if (mir_strlen(msg) > 800) {
ForkThread(&CYahooProto::im_sendackfail_longmsg, (void*)hContact);
return 1;
}
diff --git a/protocols/Yahoo/src/libyahoo2/config.h b/protocols/Yahoo/src/libyahoo2/config.h
index 5de1dbc82d..4b776e5447 100644
--- a/protocols/Yahoo/src/libyahoo2/config.h
+++ b/protocols/Yahoo/src/libyahoo2/config.h
@@ -25,11 +25,6 @@
#include <windows.h>
#include <stdio.h>
-#define strlen lstrlenA
-#define strcat lstrcatA
-#define strcmp lstrcmpA
-#define strcpy lstrcpyA
-
#ifdef _MSC_VER
#define strncasecmp strnicmp
diff --git a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp
index aa365d8631..dbad69d900 100644
--- a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp
+++ b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp
@@ -901,34 +901,34 @@ static void yahoo_packet_dump(unsigned char *data, int len)
for (i = 0; i < len; i++) {
if ((i % 8 == 0) && i)
//YAHOO_CALLBACK(ext_yahoo_log)(" ");
- lstrcatA(z, " ");
+ mir_strcat(z, " ");
if ((i % 16 == 0) && i)
- lstrcatA(z, "\n");
+ mir_strcat(z, "\n");
wsprintfA(t, "%02x ", data[i]);
- lstrcatA(z, t);
+ mir_strcat(z, t);
}
- lstrcatA(z, "\n");
+ mir_strcat(z, "\n");
YAHOO_CALLBACK(ext_yahoo_log)(z);
z[0]='\0';
for (i = 0; i < len; i++) {
if ((i % 8 == 0) && i)
//YAHOO_CALLBACK(ext_yahoo_log)(" ");
- lstrcatA(z, " ");
+ mir_strcat(z, " ");
if ((i % 16 == 0) && i)
//YAHOO_CALLBACK(ext_yahoo_log)("\n");
- lstrcatA(z, "\n");
+ mir_strcat(z, "\n");
if (isprint(data[i])) {
//YAHOO_CALLBACK(ext_yahoo_log)(" %c ", data[i]);
wsprintfA(t, " %c ", data[i]);
- lstrcatA(z, t);
+ mir_strcat(z, t);
} else
//YAHOO_CALLBACK(ext_yahoo_log)(" . ");
- lstrcatA(z, " . ");
+ mir_strcat(z, " . ");
}
//YAHOO_CALLBACK(ext_yahoo_log)("\n");
- lstrcatA(z, "\n");
+ mir_strcat(z, "\n");
YAHOO_CALLBACK(ext_yahoo_log)(z);
}
}
@@ -1347,7 +1347,7 @@ char *yahoo_decode(const char *t)
int i, k;
n = y;
- end = t + lstrlenA(t);
+ end = t + mir_strlen(t);
for (p = t; p < end; p++, n++) {
if (*p == '\\') {
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index d192490718..74d562df93 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -433,8 +433,8 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus)
* Load Yahoo ID from the database.
*/
if (!getString(YAHOO_LOGINID, &dbv)) {
- if (lstrlenA(dbv.pszVal) > 0)
- lstrcpynA(m_yahoo_id, dbv.pszVal, 255);
+ if (mir_strlen(dbv.pszVal) > 0)
+ mir_strncpy(m_yahoo_id, dbv.pszVal, 255);
else
err++;
db_free(&dbv);
@@ -445,11 +445,11 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus)
}
if (err)
- lstrcpynA(errmsg, Translate("Please enter your Yahoo ID in Options/Network/Yahoo"), 80);
+ mir_strncpy(errmsg, Translate("Please enter your Yahoo ID in Options/Network/Yahoo"), 80);
else {
if (!getString(YAHOO_PASSWORD, &dbv)) {
- if (lstrlenA(dbv.pszVal) > 0)
- lstrcpynA(m_password, dbv.pszVal, 255);
+ if (mir_strlen(dbv.pszVal) > 0)
+ mir_strncpy(m_password, dbv.pszVal, 255);
else
err++;
@@ -461,7 +461,7 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus)
}
if (err)
- lstrcpynA(errmsg, Translate("Please enter your Yahoo password in Options/Network/Yahoo"), 80);
+ mir_strncpy(errmsg, Translate("Please enter your Yahoo password in Options/Network/Yahoo"), 80);
}
if (err != 0) {
@@ -477,7 +477,7 @@ int __cdecl CYahooProto::SetStatus(int iNewStatus)
FREE(m_pw_token); // No Token yet.
if (!getString(YAHOO_PWTOKEN, &dbv)) {
- if (lstrlenA(dbv.pszVal) > 0)
+ if (mir_strlen(dbv.pszVal) > 0)
m_pw_token = strdup(dbv.pszVal);
db_free(&dbv);
@@ -527,7 +527,7 @@ void __cdecl CYahooProto::get_status_thread(void *param)
}
if (!db_get_s(hContact, "CList", "StatusMsg", &dbv)) {
- if (lstrlenA(dbv.pszVal) >= 1)
+ if (mir_strlen(dbv.pszVal) >= 1)
sm = strdup(dbv.pszVal);
db_free(&dbv);
@@ -540,34 +540,34 @@ void __cdecl CYahooProto::get_status_thread(void *param)
l = 0;
if (gm)
- l += lstrlenA(gm) + 3;
+ l += mir_strlen(gm) + 3;
- l += lstrlenA(sm) + 1;
+ l += mir_strlen(sm) + 1;
fm = (char *)malloc(l);
fm[0] = '\0';
- if (gm && lstrlenA(gm) > 0) {
+ if (gm && mir_strlen(gm) > 0) {
/* BAH YAHOO SUCKS! WHAT A PAIN!
find first carriage return add status message then add the rest */
char *c = strchr(gm, '\r');
if (c != NULL) {
- lstrcpynA(fm, gm, c - gm + 1);
+ mir_strncpy(fm, gm, c - gm + 1);
fm[c - gm + 1] = '\0';
}
else
- lstrcpyA(fm, gm);
+ mir_strcpy(fm, gm);
if (sm) {
- lstrcatA(fm, ": ");
- lstrcatA(fm, sm);
+ mir_strcat(fm, ": ");
+ mir_strcat(fm, sm);
}
if (c != NULL)
- lstrcatA(fm, c);
+ mir_strcat(fm, c);
}
else if (sm) {
- lstrcatA(fm, sm);
+ mir_strcat(fm, sm);
}
FREE(sm);
diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp
index 065539b674..020c9c34b3 100644
--- a/protocols/Yahoo/src/search.cpp
+++ b/protocols/Yahoo/src/search.cpp
@@ -24,7 +24,7 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch)
{
TCHAR *id = (TCHAR *) snsearch;
- if (lstrlen(id) < 4) {
+ if (mir_tstrlen(id) < 4) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
MessageBoxA(NULL, "Please enter a valid ID to search for.", "Search", MB_OK);
return;
@@ -167,7 +167,7 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND)
TCHAR searchid[128];
GetDlgItemText(hwndDlg, IDC_SEARCH_ID, searchid, SIZEOF(searchid));
- if (lstrlen(searchid) == 0) {
+ if (mir_tstrlen(searchid) == 0) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
MessageBoxA(NULL, "Please enter a valid ID to search for.", "Search", MB_OK);
return;
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp
index f2b179c870..108c893eb1 100644
--- a/protocols/Yahoo/src/services.cpp
+++ b/protocols/Yahoo/src/services.cpp
@@ -127,7 +127,7 @@ static INT_PTR CALLBACK DlgProcSetCustStat(HWND hwndDlg, UINT msg, WPARAM wParam
if ( !ppro->getString(YAHOO_CUSTSTATDB, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_CUSTSTAT, dbv. pszVal );
- EnableWindow( GetDlgItem(hwndDlg, IDOK ), lstrlenA(dbv.pszVal) > 0);
+ EnableWindow( GetDlgItem(hwndDlg, IDOK ), mir_strlen(dbv.pszVal) > 0);
db_free(&dbv);
}
else {
@@ -366,8 +366,8 @@ INT_PTR __cdecl CYahooProto::GetUnreadEmailCount(WPARAM wParam, LPARAM lParam)
void CYahooProto::MenuMainInit( void )
{
char servicefunction[ 100 ];
- lstrcpyA( servicefunction, m_szModuleName);
- char* tDest = servicefunction + lstrlenA( servicefunction );
+ mir_strcpy( servicefunction, m_szModuleName);
+ char* tDest = servicefunction + mir_strlen( servicefunction );
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
@@ -391,7 +391,7 @@ void CYahooProto::MenuMainInit( void )
mi.hParentMenu = hRoot;
// Show custom status menu
- lstrcpyA( tDest, YAHOO_SET_CUST_STAT );
+ mir_strcpy( tDest, YAHOO_SET_CUST_STAT );
CreateProtoService(YAHOO_SET_CUST_STAT, &CYahooProto::SetCustomStatCommand);
mi.position = 290000;
@@ -401,7 +401,7 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[0] = Menu_AddProtoMenuItem(&mi);
// Edit My profile
- lstrcpyA( tDest, YAHOO_EDIT_MY_PROFILE );
+ mir_strcpy( tDest, YAHOO_EDIT_MY_PROFILE );
CreateProtoService(YAHOO_EDIT_MY_PROFILE, &CYahooProto::OnEditMyProfile);
mi.position = 290005;
@@ -410,7 +410,7 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[1] = Menu_AddProtoMenuItem(&mi);
// Show My profile
- lstrcpyA( tDest, YAHOO_SHOW_MY_PROFILE );
+ mir_strcpy( tDest, YAHOO_SHOW_MY_PROFILE );
CreateProtoService(YAHOO_SHOW_MY_PROFILE, &CYahooProto::OnShowMyProfileCommand);
mi.position = 290006;
@@ -419,7 +419,7 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[2] = Menu_AddProtoMenuItem(&mi);
// Show Yahoo mail
- strcpy( tDest, YAHOO_YAHOO_MAIL );
+ mir_strcpy( tDest, YAHOO_YAHOO_MAIL );
CreateProtoService(YAHOO_YAHOO_MAIL, &CYahooProto::OnGotoMailboxCommand);
mi.position = 290010;
@@ -428,7 +428,7 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[3] = Menu_AddProtoMenuItem(&mi);
// Show Address Book
- strcpy(tDest, YAHOO_AB);
+ mir_strcpy(tDest, YAHOO_AB);
CreateProtoService(YAHOO_AB, &CYahooProto::OnABCommand);
mi.position = 290015;
@@ -437,45 +437,34 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[4] = Menu_AddProtoMenuItem(&mi);
// Show Calendar
- strcpy( tDest, YAHOO_CALENDAR );
+ mir_strcpy( tDest, YAHOO_CALENDAR );
CreateProtoService(YAHOO_CALENDAR, &CYahooProto::OnCalendarCommand);
mi.position = 290017;
mi.icolibItem = GetIconHandle( IDI_CALENDAR );
mi.pszName = LPGEN("&Calendar");
menuItemsAll[5] = Menu_AddProtoMenuItem(&mi);
- strcpy( tDest, "/JoinChatRoom");
+ mir_strcpy( tDest, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CYahooProto::CreateConference);
mi.position = 290018;
mi.icolibItem = GetIconHandle(IDI_YAHOO);
mi.pszName = LPGEN("Create Conference");
menuItemsAll[6] = Menu_AddProtoMenuItem(&mi);
-
-
- // Show Refresh
- /*strcpy( tDest, YAHOO_REFRESH );
- CreateProtoService(YAHOO_REFRESH, &CYahooProto::OnRefreshCommand);
-
- mi.position = 500090015;
- mi.icolibItem = GetIconHandle( IDI_REFRESH );
- mi.pszName = LPGEN("&Refresh");
- menuItemsAll[7] = Menu_AddProtoMenuItem(&mi);
- */
}
void CYahooProto::MenuContactInit( void )
{
char servicefunction[ 100 ];
- lstrcpyA( servicefunction, m_szModuleName);
- char* tDest = servicefunction + lstrlenA( servicefunction );
+ mir_strcpy( servicefunction, m_szModuleName);
+ char* tDest = servicefunction + mir_strlen( servicefunction );
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
mi.pszContactOwner = m_szModuleName;
// Show Profile
- strcpy( tDest, YAHOO_SHOW_PROFILE );
+ mir_strcpy( tDest, YAHOO_SHOW_PROFILE );
CreateProtoService(YAHOO_SHOW_PROFILE, &CYahooProto::OnShowProfileCommand );
mi.position = -2000006000;
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp
index 85f26616c7..40a035284c 100644
--- a/protocols/Yahoo/src/user_info.cpp
+++ b/protocols/Yahoo/src/user_info.cpp
@@ -1,9 +1,9 @@
/*
* $Id: proto.cpp 9802 2009-05-18 03:03:48Z gena01 $
*
- * myYahoo Miranda Plugin
+ * myYahoo Miranda Plugin
*
- * Authors: Gennady Feldman (aka Gena01)
+ * Authors: Gennady Feldman (aka Gena01)
* Laurent Marechal (aka Peorth)
*
* This code is under GPL and is based on AIM, MSN and Miranda source code.
@@ -30,7 +30,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa
//SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS));
-
+
break;
case WM_NOTIFY:
@@ -61,39 +61,39 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa
if (hContact) {
DBVARIANT dbv;
char z[128];
-
+
if (ppro->getString( hContact, YAHOO_LOGINID, &dbv) == 0) {
- strcpy(z, dbv.pszVal);
+ mir_strcpy(z, dbv.pszVal);
db_free(&dbv);
} else {
- strcpy(z, "???");
+ mir_strcpy(z, "???");
}
-
+
SetDlgItemTextA(hwndDlg, IDC_SEARCH_ID, z);
-
+
if (ppro->getString( hContact, "Transport", &dbv) == 0) {
- strcpy(z, dbv.pszVal);
+ mir_strcpy(z, dbv.pszVal);
db_free(&dbv);
} else {
- strcpy(z, "Yahoo");
+ mir_strcpy(z, "Yahoo");
}
-
+
SetDlgItemTextA(hwndDlg, IDC_SEARCH_PROTOCOL, z);
-
+
if (ppro->getString( hContact, "MirVer", &dbv) == 0) {
- strcpy(z, dbv.pszVal);
+ mir_strcpy(z, dbv.pszVal);
db_free(&dbv);
} else {
- strcpy(z, "???");
+ mir_strcpy(z, "???");
}
-
+
SetDlgItemTextA(hwndDlg, IDC_NFO_CLIENT, z);
-
+
} else {
}
}
break;
- }
+ }
}
break;
@@ -102,7 +102,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa
break;
case WM_DESTROY:
-
+
break;
}
return FALSE;
@@ -125,7 +125,6 @@ int __cdecl CYahooProto::OnUserInfoInit( WPARAM wParam, LPARAM lParam )
odp.pszTemplate = MAKEINTRESOURCEA( IDD_USER_INFO );
odp.ptszTitle = m_tszUserName;
UserInfo_AddPage(wParam, &odp);
- }
+ }
return 0;
}
-
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp
index e806efb274..46e84b09c6 100644
--- a/protocols/Yahoo/src/util.cpp
+++ b/protocols/Yahoo/src/util.cpp
@@ -111,8 +111,8 @@ int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char *
POPUPDATAT ppd = { 0 };
ppd.PluginWindowProc = PopupWindowProc;
- lstrcpyn(ppd.lptzContactName, nickname, SIZEOF(ppd.lptzContactName));
- lstrcpyn(ppd.lptzText, msg, SIZEOF(ppd.lptzText));
+ mir_tstrncpy(ppd.lptzContactName, nickname, SIZEOF(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzText, msg, SIZEOF(ppd.lptzText));
if (szURL != NULL) {
ppd.lchIcon = LoadIconEx( !lstrcmpiA(szURL, "http://mail.yahoo.com") ? "mail" : "calendar");
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp
index 7ecf6dc61f..67a150e60a 100644
--- a/protocols/Yahoo/src/yahoo.cpp
+++ b/protocols/Yahoo/src/yahoo.cpp
@@ -324,7 +324,7 @@ MCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, in
setString( hContact, YAHOO_LOGINID, yid );
Set_Protocol( hContact, protocol );
- if (lstrlenA(yahoo_name) > 0)
+ if (mir_strlen(yahoo_name) > 0)
SetStringUtf( hContact, "Nick", yahoo_name );
else
SetStringUtf( hContact, "Nick", yahoo_id );
@@ -820,16 +820,16 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha
pre.flags = PREF_UTF;
pre.timestamp = time(NULL);
- pre.lParam = sizeof(DWORD)+sizeof(HANDLE)+lstrlenA(who)+lstrlenA(nick)+5;
+ pre.lParam = sizeof(DWORD)+sizeof(HANDLE)+mir_strlen(who)+mir_strlen(nick)+5;
if (fname != NULL)
- pre.lParam += lstrlenA(fname);
+ pre.lParam += mir_strlen(fname);
if (lname != NULL)
- pre.lParam += lstrlenA(lname);
+ pre.lParam += mir_strlen(lname);
if (msg != NULL)
- pre.lParam += lstrlenA(msg);
+ pre.lParam += mir_strlen(msg);
pCurBlob = (PBYTE)malloc(pre.lParam);
pre.szMessage = (char *)pCurBlob;
@@ -843,24 +843,24 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha
pCurBlob += sizeof(DWORD);
// NICK
- lstrcpyA((char*)pCurBlob, nick);
+ mir_strcpy((char*)pCurBlob, nick);
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// FIRST
- lstrcpyA((char*)pCurBlob, (fname != NULL) ? fname : "");
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ mir_strcpy((char*)pCurBlob, (fname != NULL) ? fname : "");
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// LAST
- lstrcpyA((char*)pCurBlob, (lname != NULL) ? lname : "");
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ mir_strcpy((char*)pCurBlob, (lname != NULL) ? lname : "");
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// E-mail
- lstrcpyA((char*)pCurBlob,who);
- pCurBlob+=lstrlenA((char *)pCurBlob)+1;
+ mir_strcpy((char*)pCurBlob,who);
+ pCurBlob+=mir_strlen((char *)pCurBlob)+1;
// Reason
- lstrcpyA((char*)pCurBlob, (msg != NULL) ? msg : "");
+ mir_strcpy((char*)pCurBlob, (msg != NULL) ? msg : "");
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
}
@@ -929,7 +929,7 @@ void CYahooProto::ext_game_notify(const char *me, const char *who, int stat, con
* [17:18:38 YAHOO] [ext_yahoo_game_notify] id: 1, me: xxxxx, who: rrrrr,
* stat: 2, msg: 1 ygamesa 2
*/
- z = (char *) _alloca(lstrlenA(l) + 50);
+ z = (char *) _alloca(mir_strlen(l) + 50);
z[0]='\0';
do{
@@ -950,16 +950,16 @@ void CYahooProto::ext_game_notify(const char *me, const char *who, int stat, con
if (c != NULL) {
(*c) = '\0';
- lstrcatA(z, l);
- lstrcatA(z, "\r\n");
+ mir_strcat(z, l);
+ mir_strcat(z, "\r\n");
l = c + 1;
} else {
- lstrcatA(z, l);
+ mir_strcat(z, l);
}
} while (c != NULL);
- lstrcatA(z, "\r\n\r\nhttp://games.yahoo.com/games/");
- lstrcatA(z, u);
+ mir_strcat(z, "\r\n\r\nhttp://games.yahoo.com/games/");
+ mir_strcat(z, u);
c = strchr(z, 0x09);
(*c) = '\0';
}
@@ -1557,8 +1557,8 @@ void CYahooProto::ext_login(enum yahoo_status login_mode)
}
}
- lstrcpynA(fthost,getByte("YahooJapan",0)?"filetransfer.msg.yahoo.co.jp":"filetransfer.msg.yahoo.com" , sizeof(fthost));
- lstrcpynA(login_host,getByte("YahooJapan",0)?"login.yahoo.co.jp":"login.yahoo.com" , sizeof(login_host));
+ mir_strncpy(fthost,getByte("YahooJapan",0)?"filetransfer.msg.yahoo.co.jp":"filetransfer.msg.yahoo.com" , sizeof(fthost));
+ mir_strncpy(login_host,getByte("YahooJapan",0)?"login.yahoo.co.jp":"login.yahoo.com" , sizeof(login_host));
port = getWord(NULL, YAHOO_LOGINPORT, YAHOO_DEFAULT_PORT);
#ifdef HTTP_GATEWAY
diff --git a/src/core/stdauth/authdialogs.cpp b/src/core/stdauth/authdialogs.cpp
index e8894a8aa6..99000a8663 100644
--- a/src/core/stdauth/authdialogs.cpp
+++ b/src/core/stdauth/authdialogs.cpp
@@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
off = mir_sntprintf(name, SIZEOF(name), _T("%s"), (TCHAR*)firstT);
else if (lastT[0])
off = mir_sntprintf(name, SIZEOF(name), _T("%s"), (TCHAR*)lastT);
- if (lstrlen(nickT)) {
+ if (mir_tstrlen(nickT)) {
if (off)
mir_sntprintf(name + off, SIZEOF(name) - off, _T(" (%s)"), (TCHAR*)nickT);
else
diff --git a/src/core/stdaway/sendmsg.cpp b/src/core/stdaway/sendmsg.cpp
index d3ee3ea38e..53273ab9a6 100644
--- a/src/core/stdaway/sendmsg.cpp
+++ b/src/core/stdaway/sendmsg.cpp
@@ -131,10 +131,10 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto)
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, SIZEOF(substituteStr));
else continue;
- if (lstrlen(substituteStr) > 6)
- dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (lstrlen(dbv.ptszVal) + 1 + lstrlen(substituteStr) - 6) * sizeof(TCHAR));
- MoveMemory(dbv.ptszVal + i + lstrlen(substituteStr), dbv.ptszVal + i + 6, (lstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
- CopyMemory(dbv.ptszVal+i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > 6)
+ dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ MoveMemory(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
+ CopyMemory(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
}
return dbv.ptszVal;
@@ -408,7 +408,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Default"), &dbv))
if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Msg"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(statusModes[i]));
- lstrcpy(dat->info[j].msg, dbv.ptszVal);
+ mir_tstrcpy(dat->info[j].msg, dbv.ptszVal);
mir_free(dbv.ptszVal);
}
if (hLst)
diff --git a/src/core/stdchat/src/log.cpp b/src/core/stdchat/src/log.cpp
index 0e5a94edb5..458183baf6 100644
--- a/src/core/stdchat/src/log.cpp
+++ b/src/core/stdchat/src/log.cpp
@@ -31,7 +31,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
if (lstrdat->buffer == NULL) {
lstrdat->bufferOffset = 0;
lstrdat->buffer = pci->Log_CreateRTF(lstrdat);
- lstrdat->bufferLen = lstrlenA(lstrdat->buffer);
+ lstrdat->bufferLen = mir_strlen(lstrdat->buffer);
}
// give the RTF to the RE control
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index 20fa87ee44..e7dbb03ab0 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -534,9 +534,9 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
SHGetPathFromIDList(idList, szDirectory);
- lstrcat(szDirectory, _T("\\"));
+ mir_tstrcat(szDirectory, _T("\\"));
PathToRelativeT(szDirectory, szTemp);
- SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, lstrlen(szTemp) > 1 ? szTemp : _T("Logs\\"));
+ SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(szTemp) > 1 ? szTemp : _T("Logs\\"));
CoTaskMemFree(idList);
}
}
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp
index 81d154ce41..61f4679a40 100644
--- a/src/core/stdchat/src/tools.cpp
+++ b/src/core/stdchat/src/tools.cpp
@@ -53,7 +53,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
if (db_get_ts(NULL, "SRMM", str, &dbv))
_tcscpy(lf->lfFaceName, _T("Arial"));
else {
- lstrcpyn(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
@@ -146,10 +146,10 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
if (pszWordText)
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
else
- lstrcpyn(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
+ mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
- if (lstrlen(szTemp) > 40)
- lstrcpy(szTemp + 40, _T("..."));
+ if (mir_tstrlen(szTemp) > 40)
+ mir_tstrcpy(szTemp + 40, _T("..."));
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp
index b14db35b51..15d1e0e6d8 100644
--- a/src/core/stdchat/src/window.cpp
+++ b/src/core/stdchat/src/window.cpp
@@ -393,10 +393,10 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
end ++;
if ( dat->szTabSave[0] =='\0')
- lstrcpyn( dat->szTabSave, pszText+start, end-start+1 );
+ mir_tstrncpy( dat->szTabSave, pszText+start, end-start+1 );
pszSelName = (TCHAR *)mir_alloc( sizeof(TCHAR)*( end-start+1 ));
- lstrcpyn( pszSelName, pszText+start, end-start+1);
+ mir_tstrncpy( pszSelName, pszText+start, end-start+1);
pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName);
if (pszName == NULL) {
pszName = dat->szTabSave;
@@ -1543,9 +1543,9 @@ END_REMOVETAB:
int insertat;
TCHAR szTemp [30];
- lstrcpyn(szTemp, s1->ptszName, 21);
- if (lstrlen(s1->ptszName) >20)
- lstrcpyn(szTemp+20, _T("..."), 4);
+ mir_tstrncpy(szTemp, s1->ptszName, 21);
+ if (mir_tstrlen(s1->ptszName) >20)
+ mir_tstrncpy(szTemp+20, _T("..."), 4);
tci.mask = TCIF_TEXT|TCIF_PARAM ;
tci.pszText = szTemp;
@@ -1790,7 +1790,7 @@ END_REMOVETAB:
}
SetTextColor(dis->hDC, ui->iStatusEx == 0?g_Settings.crUserListColor:g_Settings.crUserListHeadingsColor);
- TextOut(dis->hDC, dis->rcItem.left+x_offset, dis->rcItem.top, ui->pszNick, lstrlen(ui->pszNick));
+ TextOut(dis->hDC, dis->rcItem.left+x_offset, dis->rcItem.top, ui->pszNick, (int)mir_tstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
if (si->pAccPropServicesForNickList) {
@@ -2136,9 +2136,9 @@ LABEL_SHOWWINDOW:
tr.lpstrText = pszWord;
long iRes = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0) {
- int iLen = lstrlen(pszWord) - 1;
+ int iLen = (int)mir_tstrlen(pszWord)-1;
while (iLen >= 0 && _tcschr(szTrimString, pszWord[iLen])) {
- pszWord[iLen] = _T('\0');
+ pszWord[iLen] = 0;
iLen--;
} } }
@@ -2240,8 +2240,8 @@ LABEL_SHOWWINDOW:
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1));
- lstrcpy(( TCHAR* )GlobalLock(hData), tr.lpstrText);
+ hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
+ mir_tstrcpy(( TCHAR* )GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -2295,11 +2295,11 @@ LABEL_SHOWWINDOW:
if (GetKeyState(VK_SHIFT) & 0x8000) {
LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
- TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(lstrlen(ui->pszUID) + 3));
+ TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(mir_tstrlen(ui->pszUID) + 3));
if (start == 0)
- mir_sntprintf(pszName, lstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID);
+ mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID);
else
- mir_sntprintf(pszName, lstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
+ mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp
index 3bfb0597b2..d312d5ce4a 100644
--- a/src/core/stdclist/src/clcpaint.cpp
+++ b/src/core/stdclist/src/clcpaint.cpp
@@ -320,14 +320,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight);
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, lstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, mir_tstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
width = textSize.cx;
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]);
if (szCounts[0]) {
GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize);
+ GetTextExtentPoint32A(hdcMem, szCounts, mir_strlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -424,7 +424,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText));
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText));
rc.left = rc.right + 6 + textSize.cx;
rc.right = clRect.right;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
@@ -440,7 +440,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
if (rc.right < rc.left + 4)
rc.right = clRect.right + 1;
else
- TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts));
+ TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, mir_strlen(szCounts));
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
@@ -448,12 +448,12 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
SetHotTrackColour(hdcMem, dat);
rc.right--;
ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText), NULL);
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText), NULL);
}
else
TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace,
y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText));
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText));
if (dat->exStyle & CLS_EX_LINEWITHGROUPS) {
rc.top = y + (dat->rowHeight >> 1);
rc.bottom = rc.top + 2;
@@ -470,14 +470,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
rc.right = (clRect.right - clRect.left);
rc.bottom = rc.top;
- DrawText(hdcMem, szText, lstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ DrawText(hdcMem, szText, mir_tstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
}
if (selected) {
if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) {
TCHAR *szText = group->cl.items[group->scanIndex]->szText;
RECT rc;
- int qlen = lstrlen(dat->szQuickSearch);
+ int qlen = mir_tstrlen(dat->szQuickSearch);
SetTextColor(hdcMem, dat->quickSearchColour);
rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
diff --git a/src/core/stdemail/email.cpp b/src/core/stdemail/email.cpp
index 23ae28da48..d73786d379 100644
--- a/src/core/stdemail/email.cpp
+++ b/src/core/stdemail/email.cpp
@@ -42,9 +42,9 @@ static INT_PTR SendEMailCommand(WPARAM hContact, LPARAM lParam)
return 1;
}
}
- char *szUrl = (char*)mir_alloc(lstrlenA(dbv.pszVal)+8);
- lstrcpyA(szUrl, "mailto:");
- lstrcatA(szUrl, dbv.pszVal);
+ char *szUrl = (char*)mir_alloc(mir_strlen(dbv.pszVal)+8);
+ mir_strcpy(szUrl, "mailto:");
+ mir_strcat(szUrl, dbv.pszVal);
mir_free(dbv.pszVal);
forkthread(SendEmailThread, 0, szUrl);
return 0;
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp
index 004eb72ccd..5e5b32da4d 100644
--- a/src/core/stdfile/file.cpp
+++ b/src/core/stdfile/file.cpp
@@ -98,7 +98,7 @@ static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam)
TCHAR buf[MAX_PATH];
GetContactReceivedFilesDir(wParam, buf, MAX_PATH, TRUE);
char* dir = mir_t2a(buf);
- lstrcpynA((char*)lParam, dir, MAX_PATH);
+ mir_strncpy((char*)lParam, dir, MAX_PATH);
mir_free(dir);
return 0;
}
@@ -358,9 +358,9 @@ static void sttRecvCreateBlob(DBEVENTINFO &dbei, int fileCount, char **pszFiles,
dbei.cbBlob = sizeof(DWORD);
for (int i = 0; i < fileCount; i++)
- dbei.cbBlob += lstrlenA(pszFiles[i]) + 1;
+ dbei.cbBlob += mir_strlen(pszFiles[i]) + 1;
- dbei.cbBlob += lstrlenA(szDescr) + 1;
+ dbei.cbBlob += mir_strlen(szDescr) + 1;
if ((dbei.pBlob = (BYTE*)mir_alloc(dbei.cbBlob)) == 0)
return;
@@ -369,7 +369,7 @@ static void sttRecvCreateBlob(DBEVENTINFO &dbei, int fileCount, char **pszFiles,
BYTE* p = dbei.pBlob + sizeof(DWORD);
for (int i = 0; i < fileCount; i++) {
strcpy((char*)p, pszFiles[i]);
- p += lstrlenA(pszFiles[i]) + 1;
+ p += mir_strlen(pszFiles[i]) + 1;
}
strcpy((char*)p, (szDescr == NULL) ? "" : szDescr);
}
diff --git a/src/core/stdfile/fileexistsdlg.cpp b/src/core/stdfile/fileexistsdlg.cpp
index 1e604c2947..4bf7da405a 100644
--- a/src/core/stdfile/fileexistsdlg.cpp
+++ b/src/core/stdfile/fileexistsdlg.cpp
@@ -149,7 +149,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
TCHAR *pszExtension = _tcsrchr(pszFilename, '.');
if (pszExtension)
- lstrcpyn(szExtension, pszExtension + 1, SIZEOF(szExtension));
+ mir_tstrncpy(szExtension, pszExtension + 1, SIZEOF(szExtension));
else {
pszExtension = _T(".");
szExtension[0] = '\0';
@@ -166,7 +166,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
else {
TCHAR szTypeName[MAX_PATH];
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, SIZEOF(szTypeName))) {
- lstrcat(szTypeName, _T("\\DefaultIcon"));
+ mir_tstrcat(szTypeName, _T("\\DefaultIcon"));
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, SIZEOF(szIconFile))) {
if (_tcsstr(szIconFile, _T("%1")))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, SIZEOF(szIconFile));
@@ -244,7 +244,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_OPENFOLDER:
{
TCHAR szFile[MAX_PATH];
- lstrcpyn(szFile, fts->tszCurrentFile, SIZEOF(szFile));
+ mir_tstrncpy(szFile, fts->tszCurrentFile, SIZEOF(szFile));
TCHAR *pszLastBackslash = _tcsrchr(szFile, '\\');
if (pszLastBackslash)
*pszLastBackslash = '\0';
@@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR filter[512], *pfilter;
TCHAR str[MAX_PATH];
- lstrcpyn(str, fts->tszCurrentFile, SIZEOF(str));
+ mir_tstrncpy(str, fts->tszCurrentFile, SIZEOF(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp
index 68e84dcf73..9509e14dda 100644
--- a/src/core/stdfile/filerecvdlg.cpp
+++ b/src/core/stdfile/filerecvdlg.cpp
@@ -38,7 +38,7 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi
DWORD dwAttributes;
TCHAR *pszLastBackslash;
- lstrcpyn(szExistingDir, szTestDir, cchExistingDir);
+ mir_tstrncpy(szExistingDir, szTestDir, cchExistingDir);
while ((dwAttributes = GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
pszLastBackslash = _tcsrchr(szExistingDir, '\\');
if (pszLastBackslash == NULL) { *szExistingDir = '\0'; break; }
@@ -96,7 +96,7 @@ int BrowseForFolder(HWND hwnd, TCHAR *szPath)
LPITEMIDLIST pidlResult = SHBrowseForFolder(&bi);
if (pidlResult) {
SHGetPathFromIDList(pidlResult, szPath);
- lstrcat(szPath, _T("\\"));
+ mir_tstrcat(szPath, _T("\\"));
CoTaskMemFree(pidlResult);
}
return pidlResult != NULL;
@@ -123,9 +123,9 @@ static void patchDir(TCHAR *str, size_t strSize)
mir_free(result);
}
- size_t len = lstrlen(str);
+ size_t len = mir_tstrlen(str);
if (len + 1 < strSize && str[len - 1] != '\\')
- lstrcpy(str + len, _T("\\"));
+ mir_tstrcpy(str + len, _T("\\"));
}
void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL patchVars)
@@ -170,7 +170,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO
if (patchVars)
patchDir(tszTemp, SIZEOF(tszTemp));
RemoveInvalidPathChars(tszTemp);
- lstrcpyn(szDir, tszTemp, cchDir);
+ mir_tstrncpy(szDir, tszTemp, cchDir);
}
void GetReceivedFilesDir(TCHAR *szDir, int cchDir)
@@ -185,7 +185,7 @@ void GetReceivedFilesDir(TCHAR *szDir, int cchDir)
patchDir(tszTemp, SIZEOF(tszTemp));
RemoveInvalidPathChars(tszTemp);
- lstrcpyn(szDir, tszTemp, cchDir);
+ mir_tstrncpy(szDir, tszTemp, cchDir);
}
INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -341,7 +341,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
GetDlgItemText(hwndDlg, IDC_FILEDIR, szRecvDir, SIZEOF(szRecvDir));
RemoveInvalidPathChars(szRecvDir);
GetContactReceivedFilesDir(NULL, szDefaultRecvDir, SIZEOF(szDefaultRecvDir), TRUE);
- if (_tcsnicmp(szRecvDir, szDefaultRecvDir, lstrlen(szDefaultRecvDir))) {
+ if (_tcsnicmp(szRecvDir, szDefaultRecvDir, mir_tstrlen(szDefaultRecvDir))) {
char idstr[32];
int i;
DBVARIANT dbv;
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp
index b6fdfe2ec4..c207cb9ff0 100644
--- a/src/core/stdfile/filesenddlg.cpp
+++ b/src/core/stdfile/filesenddlg.cpp
@@ -53,11 +53,11 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat)
mir_sntprintf(str, SIZEOF(str), szFormat, fileCount, dirCount);
}
else if (fileCount) {
- lstrcpy(szFormat, TranslateT("%d files"));
+ mir_tstrcpy(szFormat, TranslateT("%d files"));
mir_sntprintf(str, SIZEOF(str), szFormat, fileCount);
}
else {
- lstrcpy(szFormat, TranslateT("%d directories"));
+ mir_tstrcpy(szFormat, TranslateT("%d directories"));
mir_sntprintf(str, SIZEOF(str), szFormat, dirCount);
}
SetDlgItemText(hwndDlg, IDC_FILE, str);
@@ -88,12 +88,12 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
// NULL separated list of all files
// fileOffset is the offset to the first file.
- fileOffset = lstrlen(buf) + 1;
+ fileOffset = mir_tstrlen(buf) + 1;
// Count number of files
pBuf = buf + fileOffset;
while (*pBuf) {
- pBuf += lstrlen(pBuf) + 1;
+ pBuf += mir_tstrlen(pBuf) + 1;
nNumberOfFiles++;
}
@@ -106,7 +106,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
nTemp = 0;
while (*pBuf) {
// Allocate space for path+filename
- int cbFileNameLen = lstrlen(pBuf);
+ int cbFileNameLen = mir_tstrlen(pBuf);
dat->files[nTemp] = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileOffset + cbFileNameLen + 1));
// Add path to filename and copy into array
@@ -147,11 +147,11 @@ void __cdecl ChooseFilesThread(void* param)
}
TCHAR filter[128];
- lstrcpy(filter, TranslateT("All files"));
- lstrcat(filter, _T(" (*)"));
- TCHAR *pfilter = filter + lstrlen(filter) + 1;
- lstrcpy(pfilter, _T("*"));
- pfilter = filter + lstrlen(filter) + 1;
+ mir_tstrcpy(filter, TranslateT("All files"));
+ mir_tstrcat(filter, _T(" (*)"));
+ TCHAR *pfilter = filter + mir_tstrlen(filter) + 1;
+ mir_tstrcpy(pfilter, _T("*"));
+ pfilter = filter + mir_tstrlen(filter) + 1;
pfilter[0] = '\0';
OPENFILENAME ofn = { 0 };
diff --git a/src/core/stdfile/filexferdlg.cpp b/src/core/stdfile/filexferdlg.cpp
index 18c8e3b5a4..f5eeeec531 100644
--- a/src/core/stdfile/filexferdlg.cpp
+++ b/src/core/stdfile/filexferdlg.cpp
@@ -85,11 +85,11 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei)
char *szFileNames = Utf8EncodeT(dat->szFilenames), *szMsg = Utf8EncodeT(dat->szMsg);
dbei.flags |= DBEF_UTF;
- dbei.cbBlob = sizeof(DWORD) + lstrlenA(szFileNames) + lstrlenA(szMsg) + 2;
+ dbei.cbBlob = sizeof(DWORD) + mir_strlen(szFileNames) + mir_strlen(szMsg) + 2;
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
*(PDWORD)dbei.pBlob = 0;
- lstrcpyA((char*)dbei.pBlob + sizeof(DWORD), szFileNames);
- lstrcpyA((char*)dbei.pBlob + sizeof(DWORD) + lstrlenA(szFileNames) + 1, szMsg);
+ mir_strcpy((char*)dbei.pBlob + sizeof(DWORD), szFileNames);
+ mir_strcpy((char*)dbei.pBlob + sizeof(DWORD) + mir_strlen(szFileNames) + 1, szMsg);
mir_free(szFileNames), mir_free(szMsg);
}
@@ -109,7 +109,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
*pszReplace = 0;
mir_sntprintf(szCmdLine, SIZEOF(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2);
}
- else lstrcpyn(szCmdLine, dbv.ptszVal, SIZEOF(szCmdLine));
+ else mir_tstrncpy(szCmdLine, dbv.ptszVal, SIZEOF(szCmdLine));
PROCESS_INFORMATION pi;
if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
@@ -155,7 +155,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE
dat->hIcon = shfi.hIcon;
}
else {
- lstrcpyn(msg, pcli->pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg));
+ mir_tstrncpy(msg, pcli->pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg));
HICON hIcon = LoadSkinIcon(SKINICON_OTHER_DOWNARROW);
dat->hIcon = CopyIcon(hIcon);
IcoLib_ReleaseIcon(hIcon, NULL);
@@ -310,7 +310,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
GetSensiblyFormattedSize((dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]) / dat->bytesRecvedHistorySize, szSpeed, SIZEOF(szSpeed), 0, 1, NULL);
if (dat->bytesRecvedHistory[0] == dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1])
- lstrcpy(szTime, _T("??:??:??"));
+ mir_tstrcpy(szTime, _T("??:??:??"));
else {
li.QuadPart = BIGI(10000000)*(dat->transferStatus.currentFileSize - dat->transferStatus.currentFileProgress)*dat->bytesRecvedHistorySize / (dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]);
ft.dwHighDateTime = li.HighPart; ft.dwLowDateTime = li.LowPart;
@@ -477,9 +477,9 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
TCHAR *pszExtension, *pszFilename;
if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename;
- if ((pszExtension = _tcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + lstrlen(pszFilename);
+ if ((pszExtension = _tcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + mir_tstrlen(pszFilename);
if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
- size_t size = (pszExtension - szOriginalFilename) + 21 + lstrlen(pszExtension);
+ size_t size = (pszExtension - szOriginalFilename) + 21 + mir_tstrlen(pszExtension);
pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
for (int i = 1;; i++) {
mir_sntprintf((TCHAR*)pfr->szFilename, size, _T("%.*s (%u)%s"), pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 386d1af01c..50e3f35dc7 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -550,7 +550,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendMessage(GetDlgItem(hwndDlg, IDOK), WM_GETFONT, 0, 0));
SIZE textSize;
- GetTextExtentPoint32(hdc, buf, lstrlen(buf), &textSize);
+ GetTextExtentPoint32(hdc, buf, (int)mir_tstrlen(buf), &textSize);
urc->rcItem.right = urc->rcItem.left + textSize.cx + 10;
if ((g_dat.flags&SMF_SHOWBTNS) && urc->rcItem.right > urc->dlgNewSize.cx - dat->nLabelRight)
urc->rcItem.right = urc->dlgNewSize.cx - dat->nLabelRight;
@@ -1144,7 +1144,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
}
else
- lstrcpyn(newtitle, TranslateT("Message session"), SIZEOF(newtitle));
+ mir_tstrncpy(newtitle, TranslateT("Message session"), SIZEOF(newtitle));
TCHAR oldtitle[256];
GetWindowText(hwndDlg, oldtitle, SIZEOF(oldtitle));
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index 1ed478bc73..6e37f4ab40 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -84,7 +84,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
if (db_get_ts(NULL, SRMMMOD, str, &dbv))
_tcscpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else {
- lstrcpyn(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
diff --git a/src/core/stduihist/history.cpp b/src/core/stduihist/history.cpp
index e6c97c1ade..96de2a056e 100644
--- a/src/core/stduihist/history.cpp
+++ b/src/core/stduihist/history.cpp
@@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCHAR str[1024];
GetObjectDescription(&dbei, str, SIZEOF(str));
if (str[0]) {
- CharUpperBuff(str, lstrlen(str));
+ CharUpperBuff(str, mir_tstrlen(str));
if (_tcsstr(str, (const TCHAR*)lParam) != NULL) {
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, index, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LIST, LBN_SELCHANGE), 0);
@@ -355,7 +355,7 @@ static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam
TCHAR str[128];
HWND hwndParent = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FINDWHAT, str, SIZEOF(str));
- CharUpperBuff(str, lstrlen(str));
+ CharUpperBuff(str, mir_tstrlen(str));
SendMessage(hwndParent, DM_FINDNEXT, 0, (LPARAM)str);
return TRUE;
}
diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp
index 89ea13b76b..1e11c7b2c5 100644
--- a/src/core/stdurl/urldialogs.cpp
+++ b/src/core/stdurl/urldialogs.cpp
@@ -69,7 +69,7 @@ static void sttUpdateTitle(HWND hwndDlg, MCONTACT hContact)
mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s %s (%s)"), pszNewTitleStart, contactName, szStatus);
}
}
- else lstrcpyn(newtitle, pszNewTitleStart, SIZEOF(newtitle));
+ else mir_tstrncpy(newtitle, pszNewTitleStart, SIZEOF(newtitle));
GetWindowText(hwndDlg, oldtitle, SIZEOF(oldtitle));
@@ -103,7 +103,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
db_event_get(dat->hDbEvent, &dbei);
SetDlgItemTextA(hwndDlg, IDC_URL, (char*)dbei.pBlob);
- SetDlgItemTextA(hwndDlg, IDC_MSG, (char*)dbei.pBlob+lstrlenA((char*)dbei.pBlob)+1);
+ SetDlgItemTextA(hwndDlg, IDC_MSG, (char*)dbei.pBlob+mir_strlen((char*)dbei.pBlob)+1);
mir_free(dbei.pBlob);
db_event_markRead(dat->hContact, dat->hDbEvent);
@@ -179,8 +179,8 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
{ HGLOBAL hData;
if ( !OpenClipboard(hwndDlg)) break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(url)+1);
- lstrcpyA((char*)GlobalLock(hData), url);
+ hData = GlobalAlloc(GMEM_MOVEABLE, mir_strlen(url)+1);
+ mir_strcpy((char*)GlobalLock(hData), url);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
CloseClipboard();
@@ -550,9 +550,9 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
body = (char*)mir_alloc(bodySize);
GetDlgItemTextA(hwndDlg, IDC_MESSAGE, body, bodySize);
- dat->sendBuffer = (char*)mir_realloc(dat->sendBuffer, lstrlenA(url)+lstrlenA(body)+2);
- lstrcpyA(dat->sendBuffer, url);
- lstrcpyA(dat->sendBuffer+lstrlenA(url)+1, body);
+ dat->sendBuffer = (char*)mir_realloc(dat->sendBuffer, mir_strlen(url)+mir_strlen(body)+2);
+ mir_strcpy(dat->sendBuffer, url);
+ mir_strcpy(dat->sendBuffer+mir_strlen(url)+1, body);
dat->hAckEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
dat->hSendId = (HANDLE)CallContactService(dat->hContact, PSS_URL, 0, (LPARAM)dat->sendBuffer);
mir_free(url);
diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp
index 59d9bc93c3..1d78f2cc13 100644
--- a/src/core/stduserinfo/contactinfo.cpp
+++ b/src/core/stduserinfo/contactinfo.cpp
@@ -68,9 +68,9 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
if (szText[0]) SetWindowText(hwndDlg, TranslateT("Edit phone number"));
TranslateDialogDefault(hwndDlg);
- if (lstrlenA(szText)>4 && !lstrcmpA(szText+lstrlenA(szText)-4, " SMS")) {
+ if (mir_strlen(szText)>4 && !lstrcmpA(szText+mir_strlen(szText)-4, " SMS")) {
CheckDlgButton(hwndDlg, IDC_SMS, BST_CHECKED);
- szText[lstrlenA(szText)-4] = '\0';
+ szText[mir_strlen(szText)-4] = '\0';
}
EnableWindow(GetDlgItem(hwndDlg, IDOK), szText[0]);
SendDlgItemMessage(hwndDlg, IDC_AREA, EM_LIMITTEXT, 31, 0);
@@ -91,13 +91,13 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
{ char *szText = (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
int isValid = 1;
GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, 252);
- if (lstrlenA(szText)<7 || szText[0] != '+') isValid = 0;
- if (isValid) isValid = (lstrlenA(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
+ if (mir_strlen(szText)<7 || szText[0] != '+') isValid = 0;
+ if (isValid) isValid = (mir_strlen(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
if ( !isValid) {
MessageBox(hwndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid phone number"), MB_OK);
break;
}
- if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) lstrcatA(szText, " SMS");
+ if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) mir_strcat(szText, " SMS");
}
//fall through
case IDCANCEL:
@@ -196,11 +196,11 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
SelectObject(hdc, hEmailFont);
SIZE textSize;
- GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textSize);
+ GetTextExtentPoint32(hdc, szText, mir_tstrlen(szText), &textSize);
ReleaseDC(hwndEmails, hdc);
if (hti.pt.x < rc.left+textSize.cx) {
if (szEmail && cchEmail)
- lstrcpyn(szEmail, szText, cchEmail);
+ mir_tstrncpy(szEmail, szText, cchEmail);
return 1;
}
return 0;
@@ -328,9 +328,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if ( !db_get_ts(hContact, szProto, "Cellular", &dbv)) {
lvi.pszText = TranslateT("Mobile");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) {
+ if (mir_strlen(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+mir_strlen(dbv.pszVal)-4, " SMS")) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
- dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
+ dbv.ptszVal[mir_tstrlen(dbv.ptszVal)-4] = '\0';
}
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
@@ -359,9 +359,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.pszText = idstr2;
mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (lstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+lstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
+ if (mir_tstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+mir_tstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
- dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
+ dbv.ptszVal[mir_tstrlen(dbv.ptszVal)-4] = '\0';
}
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
@@ -493,7 +493,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DBVARIANT dbv;
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
- lstrcpynA(szText, dbv.pszVal, SIZEOF(szText));
+ mir_strncpy(szText, dbv.pszVal, SIZEOF(szText));
db_free(&dbv);
if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szText))
break;
diff --git a/src/core/stduserinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp
index 7cbaffdabb..3c407ee726 100644
--- a/src/core/stduserinfo/stdinfo.cpp
+++ b/src/core/stduserinfo/stdinfo.cpp
@@ -160,7 +160,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
default:
pstr = str;
- lstrcpyA(str, "???");
+ mir_strcpy(str, "???");
break;
}
}
@@ -514,7 +514,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- lstrcpy(lf.lfFaceName, _T("Courier New"));
+ mir_tstrcpy(lf.lfFaceName, _T("Courier New"));
lf.lfCharSet = DEFAULT_CHARSET;
hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0));
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index edbacee4b2..7401c0d991 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -364,7 +364,7 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
if (!lpinfo.tszLanguage[0] && (lpinfo.Locale == 0) || !GetLocaleInfo(lpinfo.Locale, LOCALE_SENGLANGUAGE, lpinfo.tszLanguage, sizeof(lpinfo.tszLanguage))) {
TCHAR *p = _tcschr(lpinfo.tszFileName, '_');
- lstrcpyn(lpinfo.tszLanguage, p != NULL ? p + 1 : lpinfo.tszFileName, sizeof(lpinfo.tszLanguage));
+ mir_tstrncpy(lpinfo.tszLanguage, p != NULL ? p + 1 : lpinfo.tszFileName, sizeof(lpinfo.tszLanguage));
p = _tcsrchr(lpinfo.tszLanguage, _T('.'));
if (p != NULL) *p = '\0';
}
diff --git a/src/mir_core/path.cpp b/src/mir_core/path.cpp
index ef95c31468..fbc3cff04b 100644
--- a/src/mir_core/path.cpp
+++ b/src/mir_core/path.cpp
@@ -95,7 +95,7 @@ MIR_CORE_DLL(void) CreatePathToFile(char *szFilePath)
MIR_CORE_DLL(int) CreateDirectoryTree(const char *szDir)
{
char szTestDir[MAX_PATH];
- lstrcpynA(szTestDir, szDir, SIZEOF(szTestDir));
+ mir_strncpy(szTestDir, szDir, SIZEOF(szTestDir));
DWORD dwAttributes = GetFileAttributesA(szTestDir);
if (dwAttributes != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
@@ -179,7 +179,7 @@ MIR_CORE_DLL(void) CreatePathToFileW(WCHAR *wszFilePath)
MIR_CORE_DLL(int) CreateDirectoryTreeW(const WCHAR *szDir)
{
WCHAR szTestDir[MAX_PATH];
- lstrcpynW(szTestDir, szDir, SIZEOF(szTestDir));
+ mir_wstrncpy(szTestDir, szDir, SIZEOF(szTestDir));
DWORD dwAttributes = GetFileAttributesW(szTestDir);
if (dwAttributes != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp
index efe2c397b2..61bd2d41bc 100644
--- a/src/modules/button/button.cpp
+++ b/src/modules/button/button.cpp
@@ -209,7 +209,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
SIZE sz;
TCHAR szText[MAX_PATH];
GetWindowText(ctl->hwnd, szText, SIZEOF(szText));
- GetTextExtentPoint32(hdcMem, szText, lstrlen(szText), &sz);
+ GetTextExtentPoint32(hdcMem, szText, mir_tstrlen(szText), &sz);
int xOffset = (rcClient.right - rcClient.left - sz.cx)/2;
int yOffset = (rcClient.bottom - rcClient.top - sz.cy)/2;
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index 428d1e72f8..720f643acf 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -122,7 +122,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
ptrT tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
- lstrcpy(lf->lfFaceName, FO.szDefFace);
+ mir_tstrcpy(lf->lfFaceName, FO.szDefFace);
else
_tcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
}
@@ -315,7 +315,7 @@ int OptionsInit(void)
LOGFONT lf;
LoadMsgDlgFont(18, &lf, NULL);
- lstrcpy(lf.lfFaceName, _T("MS Shell Dlg"));
+ mir_tstrcpy(lf.lfFaceName, _T("MS Shell Dlg"));
lf.lfUnderline = lf.lfItalic = lf.lfStrikeOut = 0;
lf.lfHeight = -17;
lf.lfWeight = FW_BOLD;
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 1133a66d68..e77d2013d8 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -198,7 +198,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff
}
if (szTemp[0]) {
- int iLen = lstrlenA(szTemp);
+ int iLen = mir_strlen(szTemp);
memcpy(d, szTemp, iLen);
d += iLen;
}
@@ -226,11 +226,11 @@ static void AddEventToBuffer(char **buffer, int *bufferEnd, int *bufferAlloced,
TCHAR szTemp[512], szTemp2[512];
TCHAR* pszNick = NULL;
if (streamData->lin->ptszNick) {
- if (g_Settings->bLogLimitNames && lstrlen(streamData->lin->ptszNick) > 20) {
- lstrcpyn(szTemp2, streamData->lin->ptszNick, 20);
- lstrcpyn(szTemp2 + 20, _T("..."), 4);
+ if (g_Settings->bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
+ mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 20);
+ mir_tstrncpy(szTemp2 + 20, _T("..."), 4);
}
- else lstrcpyn(szTemp2, streamData->lin->ptszNick, 511);
+ else mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 511);
if (streamData->lin->ptszUserInfo)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo);
@@ -384,8 +384,8 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
if (g_Settings->bShowTime) {
TCHAR szTimeStamp[30], szOldTimeStamp[30];
- lstrcpyn(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
- lstrcpyn(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30);
+ mir_tstrncpy(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
+ mir_tstrncpy(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30);
if (!g_Settings->bShowTimeIfChanged || streamData->si->LastTime == 0 || lstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, &buffer, &bufferEnd, &bufferAlloced, _T("%s"), szTimeStamp);
@@ -398,7 +398,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
TCHAR pszTemp[300], *p1;
Log_Append(&buffer, &bufferEnd, &bufferAlloced, "%s ", Log_SetStyle(lin->bIsMe ? 2 : 1));
- lstrcpyn(pszTemp, lin->bIsMe ? g_Settings->pszOutgoingNick : g_Settings->pszIncomingNick, 299);
+ mir_tstrncpy(pszTemp, lin->bIsMe ? g_Settings->pszOutgoingNick : g_Settings->pszIncomingNick, 299);
p1 = _tcsstr(pszTemp, _T("%n"));
if (p1)
p1[1] = 's';
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index 9028d3e02b..4f6666b99e 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -766,12 +766,12 @@ static char* SM_GetUsers(SESSION_INFO *si)
}
do {
- int pLen = lstrlenA(p), nameLen = lstrlen(utemp->pszUID);
+ int pLen = mir_strlen(p), nameLen = mir_tstrlen(utemp->pszUID);
if (pLen + nameLen + 2 > alloced)
p = (char*)mir_realloc(p, alloced += 4096);
WideCharToMultiByte(CP_ACP, 0, utemp->pszUID, -1, p + pLen, nameLen + 1, 0, 0);
- lstrcpyA(p + pLen + nameLen, " ");
+ mir_strcpy(p + pLen + nameLen, " ");
utemp = utemp->next;
}
while (utemp != NULL);
@@ -1184,7 +1184,7 @@ static BOOL UM_SetStatusEx(USERINFO* pUserList, const TCHAR* pszText, int flags)
if (s) {
pTemp->iStatusEx = 0;
if (s == pszText || s[-1] == cDelimiter) {
- int len = lstrlen(pTemp->pszUID);
+ int len = mir_tstrlen(pTemp->pszUID);
if (s[len] == cDelimiter || s[len] == '\0')
pTemp->iStatusEx = (!bOnlyMe || bSetStatus) ? 1 : 0;
}
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index 527b6307ac..160c3157b4 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -42,7 +42,7 @@ TCHAR* RemoveFormatting(const TCHAR *pszWord)
return NULL;
TCHAR *d = szTemp;
- int cbLen = lstrlen(pszWord);
+ int cbLen = mir_tstrlen(pszWord);
if (cbLen > SIZEOF(szTemp))
cbLen = SIZEOF(szTemp)-1;
@@ -165,7 +165,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
{
static TCHAR szBuf[4 * 1024];
- if (!fmt || fmt[0] == 0 || lstrlen(fmt) > 2000)
+ if (!fmt || fmt[0] == 0 || mir_tstrlen(fmt) > 2000)
return 0;
va_list marker;
@@ -186,7 +186,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
(pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
cli.pfnGetContactDisplayName(hContact, 0));
- lstrcpyn(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE);
+ mir_tstrncpy(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE);
pd.iSeconds = g_Settings->iPopupTimeout;
if (g_Settings->iPopupStyle == 2) {
@@ -469,7 +469,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
CreateDirectoryTreeT(tszFolder);
TCHAR szTime[100];
- lstrcpyn(szTime, ci.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
+ mir_tstrncpy(szTime, ci.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
FILE *hFile = _tfopen(si->pszLogFileName, _T("ab+"));
if (hFile == NULL)
@@ -480,11 +480,11 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (bFileJustCreated)
fputws((const wchar_t*)"\377\376", hFile); //UTF-16 LE BOM == FF FE
if (gce->ptszNick) {
- if (g_Settings->bLogLimitNames && lstrlen(gce->ptszNick) > 20) {
- lstrcpyn(szTemp2, gce->ptszNick, 20);
- lstrcpyn(szTemp2 + 20, _T("..."), 4);
+ if (g_Settings->bLogLimitNames && mir_tstrlen(gce->ptszNick) > 20) {
+ mir_tstrncpy(szTemp2, gce->ptszNick, 20);
+ mir_tstrncpy(szTemp2 + 20, _T("..."), 4);
}
- else lstrcpyn(szTemp2, gce->ptszNick, 511);
+ else mir_tstrncpy(szTemp2, gce->ptszNick, 511);
if (gce->ptszUserInfo)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, gce->ptszUserInfo);
@@ -739,7 +739,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
rva[10].lptzValue = NULL;
TCHAR tszTemp[MAX_PATH], *ptszVarPath;
- if (g_Settings->pszLogDir[lstrlen(g_Settings->pszLogDir) - 1] == '\\') {
+ if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') {
mir_sntprintf(tszTemp, SIZEOF(tszTemp), _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log"));
ptszVarPath = tszTemp;
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index e6914a6089..eba07e1068 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -410,7 +410,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
int i, nameLen, eq;
//check name of group and ignore message if just being expanded/collapsed
if (cli.pfnFindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, NULL)) {
- lstrcpy(szFullName, contact->szText);
+ mir_tstrcpy(szFullName, contact->szText);
while (group->parent) {
for (i=0; i < group->parent->cl.count; i++)
if (group->parent->cl.items[i]->group == group)
@@ -420,12 +420,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
}
group = group->parent;
- nameLen = lstrlen(group->cl.items[i]->szText);
- if (lstrlen(szFullName) + 1 + nameLen > SIZEOF(szFullName)) {
+ nameLen = mir_tstrlen(group->cl.items[i]->szText);
+ if (mir_tstrlen(szFullName) + 1 + nameLen > SIZEOF(szFullName)) {
szFullName[0] = '\0';
break;
}
- memmove(szFullName + 1 + nameLen, szFullName, sizeof(TCHAR)*(lstrlen(szFullName) + 1));
+ memmove(szFullName + 1 + nameLen, szFullName, sizeof(TCHAR)*(mir_tstrlen(szFullName) + 1));
memcpy(szFullName, group->cl.items[i]->szText, sizeof(TCHAR)*nameLen);
szFullName[nameLen] = '\\';
}
@@ -581,7 +581,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
- lstrcpyn(contact->szText, cli.pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, cli.pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
dat->needsResort = 1;
SortClcByTimer(hwnd);
break;
@@ -592,7 +592,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
contact->proto = GetContactProto(wParam);
cli.pfnInvalidateDisplayNameCacheEntry(wParam);
- lstrcpyn(contact->szText, cli.pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, cli.pfnGetContactDisplayName(wParam, 0), SIZEOF(contact->szText));
SortClcByTimer(hwnd);
break;
@@ -803,7 +803,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (wParam == 27) //escape
dat->szQuickSearch[0] = 0;
else if (wParam == '\b' && dat->szQuickSearch[0])
- dat->szQuickSearch[lstrlen(dat->szQuickSearch) - 1] = '\0';
+ dat->szQuickSearch[mir_tstrlen(dat->szQuickSearch) - 1] = '\0';
else if (wParam < ' ')
break;
else if (wParam == ' ' && dat->szQuickSearch[0] == '\0' && GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CHECKBOXES) {
@@ -828,7 +828,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
TCHAR szNew[2];
szNew[0] = (TCHAR) wParam;
szNew[1] = '\0';
- if (lstrlen(dat->szQuickSearch) >= SIZEOF(dat->szQuickSearch) - 1) {
+ if (mir_tstrlen(dat->szQuickSearch) >= SIZEOF(dat->szQuickSearch) - 1) {
MessageBeep(MB_OK);
break;
}
@@ -845,7 +845,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
dat->selection = index;
else {
MessageBeep(MB_OK);
- dat->szQuickSearch[ lstrlen(dat->szQuickSearch) - 1] = '\0';
+ dat->szQuickSearch[ mir_tstrlen(dat->szQuickSearch) - 1] = '\0';
cli.pfnSaveStateAndRebuildList(hwnd, dat);
}
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
@@ -1189,7 +1189,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
if (contact->type == CLCIT_GROUP) { //dropee is a group
TCHAR szNewName[120];
- lstrcpyn(szNewName, contact->szText, SIZEOF(szNewName));
+ mir_tstrncpy(szNewName, contact->szText, SIZEOF(szNewName));
cli.pfnRenameGroup(contact->groupId, szNewName);
}
else if (contact->type == CLCIT_CONTACT) //dropee is a contact
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp
index 57945bbedf..c3ee8a0980 100644
--- a/src/modules/clist/clcfiledrop.cpp
+++ b/src/modules/clist/clcfiledrop.cpp
@@ -184,15 +184,15 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR *szFil
WIN32_FIND_DATA fd;
HANDLE hFind;
TCHAR szPath[MAX_PATH];
- lstrcpy(szPath, szFilename);
- lstrcat(szPath, _T("\\*"));
+ mir_tstrcpy(szPath, szFilename);
+ mir_tstrcat(szPath, _T("\\*"));
if (hFind = FindFirstFile(szPath, &fd)) {
do {
if (!lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T("..")))
continue;
- lstrcpy(szPath, szFilename);
- lstrcat(szPath, _T("\\"));
- lstrcat(szPath, fd.cFileName);
+ mir_tstrcpy(szPath, szFilename);
+ mir_tstrcat(szPath, _T("\\"));
+ mir_tstrcat(szPath, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp
index 5e78b3e00c..ca54079ade 100644
--- a/src/modules/clist/clcitems.cpp
+++ b/src/modules/clist/clcitems.cpp
@@ -53,11 +53,11 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD
do {
pBackslash = _tcschr(pNextField, '\\');
if (pBackslash == NULL) {
- lstrcpyn(szThisField, pNextField, SIZEOF(szThisField));
+ mir_tstrncpy(szThisField, pNextField, SIZEOF(szThisField));
pNextField = NULL;
}
else {
- lstrcpyn(szThisField, pNextField, min(SIZEOF(szThisField), pBackslash - pNextField + 1));
+ mir_tstrncpy(szThisField, pNextField, min(SIZEOF(szThisField), pBackslash - pNextField + 1));
pNextField = pBackslash + 1;
}
compareResult = 1;
@@ -89,7 +89,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD
return NULL;
i = cli.pfnAddItemToGroup(group, i);
group->cl.items[i]->type = CLCIT_GROUP;
- lstrcpyn(group->cl.items[i]->szText, szThisField, SIZEOF(group->cl.items[i]->szText));
+ mir_tstrncpy(group->cl.items[i]->szText, szThisField, SIZEOF(group->cl.items[i]->szText));
group->cl.items[i]->groupId = (WORD) (pNextField ? 0 : groupId);
group->cl.items[i]->group = (ClcGroup *) mir_alloc(sizeof(ClcGroup));
group->cl.items[i]->group->parent = group;
@@ -167,7 +167,7 @@ int fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
group->cl.items[i]->type = CLCIT_INFO;
group->cl.items[i]->flags = (BYTE) flags;
group->cl.items[i]->hContact = (MCONTACT)++iInfoItemUniqueHandle;
- lstrcpyn(group->cl.items[i]->szText, pszText, SIZEOF(group->cl.items[i]->szText));
+ mir_tstrncpy(group->cl.items[i]->szText, pszText, SIZEOF(group->cl.items[i]->szText));
return i;
}
@@ -205,7 +205,7 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact)
DWORD idleMode = szProto != NULL ? db_get_dw(hContact, szProto, "IdleTS", 0) : 0;
if (idleMode)
group->cl.items[i]->flags |= CONTACTF_IDLE;
- lstrcpyn(group->cl.items[i]->szText, cli.pfnGetContactDisplayName(hContact, 0), SIZEOF(group->cl.items[i]->szText));
+ mir_tstrncpy(group->cl.items[i]->szText, cli.pfnGetContactDisplayName(hContact, 0), SIZEOF(group->cl.items[i]->szText));
ClcCacheEntry *p = cli.pfnGetCacheEntry(hContact);
if (p != NULL)
@@ -264,7 +264,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int u
}
if (!lstrcmp(szGroupName, dbv.ptszVal))
break;
- len = lstrlen(szGroupName);
+ len = mir_tstrlen(szGroupName);
if (!_tcsncmp(szGroupName, dbv.ptszVal, len) && dbv.ptszVal[len] == '\\')
cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1);
}
@@ -333,7 +333,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem)
if (group->scanIndex == group->cl.count)
break;
if (group->cl.items[i]->type == CLCIT_GROUP) {
- int len = lstrlen(group->cl.items[i]->szText);
+ int len = mir_tstrlen(group->cl.items[i]->szText);
if (!_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) &&
(dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) {
group->totalMembers--;
@@ -535,7 +535,7 @@ static void SortGroup(struct ClcData *dat, ClcGroup *group, int useInsertionSort
if (prevContactOnline) {
i = cli.pfnAddItemToGroup(group, i);
group->cl.items[i]->type = CLCIT_DIVIDER;
- lstrcpy(group->cl.items[i]->szText, TranslateT("Offline"));
+ mir_tstrcpy(group->cl.items[i]->szText, TranslateT("Offline"));
}
break;
}
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp
index c2bfae6ae4..151fbeb261 100644
--- a/src/modules/clist/clcmsgs.cpp
+++ b/src/modules/clist/clcmsgs.cpp
@@ -185,16 +185,16 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
return dat->groupIndent;
case CLM_GETISEARCHSTRING:
- lstrcpy((TCHAR*) lParam, dat->szQuickSearch);
- return lstrlen(dat->szQuickSearch);
+ mir_tstrcpy((TCHAR*) lParam, dat->szQuickSearch);
+ return mir_tstrlen(dat->szQuickSearch);
case CLM_GETITEMTEXT:
{
ClcContact *contact;
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
- lstrcpy((TCHAR*) lParam, contact->szText);
- return lstrlen(contact->szText);
+ mir_tstrcpy((TCHAR*) lParam, contact->szText);
+ return mir_tstrlen(contact->szText);
}
case CLM_GETITEMTYPE:
@@ -436,7 +436,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
ClcContact *contact;
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
- lstrcpyn(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText));
+ mir_tstrncpy(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText));
cli.pfnSortCLC(hwnd, dat, 1);
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
break;
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index f3f76a29e0..3e7b82b370 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -165,7 +165,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact *
HFONT hFont = (HFONT)SelectObject(hdc, dat->fontInfo[hitcontact->type == CLCIT_GROUP ? FONTID_GROUPS : FONTID_CONTACTS].hFont);
SIZE textSize;
- GetTextExtentPoint32(hdc, hitcontact->szText, lstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, mir_tstrlen(hitcontact->szText), &textSize);
int width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
char *szCounts;
@@ -174,7 +174,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact *
GetTextExtentPoint32A(hdc, " ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32A(hdc, szCounts, lstrlenA(szCounts), &textSize);
+ GetTextExtentPoint32A(hdc, szCounts, mir_strlen(szCounts), &textSize);
width += textSize.cx;
}
}
@@ -354,7 +354,7 @@ void fnDoSelectionDefaultAction(HWND hwnd, struct ClcData *dat)
int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk)
{
ClcGroup *group = &dat->list;
- int testlen = lstrlen(text);
+ int testlen = mir_tstrlen(text);
group->scanIndex = 0;
for (;;) {
@@ -691,7 +691,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
ptrT tszFace(db_get_tsa(NULL, "CLC", idstr));
if (tszFace)
- lstrcpy(lf->lfFaceName, tszFace);
+ mir_tstrcpy(lf->lfFaceName, tszFace);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
*colour = db_get_dw(NULL, "CLC", idstr, *colour);
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index 45f31f0e1a..4edff9c697 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -139,7 +139,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
}
else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s%s %s"), szPrefix, szSeparator, pa->tszAccountName, szStatus);
}
- else lstrcpyn(cli.szTip, szPrefix, MAX_TIP_SIZE);
+ else mir_tstrncpy(cli.szTip, szPrefix, MAX_TIP_SIZE);
}
else {
if (mToolTipTrayTips) {
@@ -182,7 +182,7 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s
cli.pfnTrayIconMakeTooltip(NULL, cli.trayIcon[i].szProto);
if (!mToolTipTrayTips)
- lstrcpyn(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
+ mir_tstrncpy(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
Shell_NotifyIcon(NIM_ADD, &nid);
@@ -342,7 +342,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
mir_free(cli.trayIcon[i].ptszToolTip);
cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
if (!mToolTipTrayTips)
- lstrcpyn(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
+ mir_tstrncpy(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
if (cli.trayIconCount == 1)
@@ -364,7 +364,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
mir_free(cli.trayIcon[i].ptszToolTip);
cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
if (!mToolTipTrayTips)
- lstrcpyn(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
+ mir_tstrncpy(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
if (cli.trayIconCount == 1)
@@ -816,8 +816,8 @@ int fnCListTrayNotify(MIRANDASYSTRAYNOTIFY* msn)
nid.hWnd = cli.hwndContactList;
nid.uID = iconId;
nid.uFlags = NIF_INFO;
- lstrcpynW(nid.szInfo, msn->tszInfo, SIZEOF(nid.szInfo));
- lstrcpynW(nid.szInfoTitle, msn->tszInfoTitle, SIZEOF(nid.szInfoTitle));
+ mir_wstrncpy(nid.szInfo, msn->tszInfo, SIZEOF(nid.szInfo));
+ mir_wstrncpy(nid.szInfoTitle, msn->tszInfoTitle, SIZEOF(nid.szInfoTitle));
nid.szInfo[SIZEOF(nid.szInfo) - 1] = 0;
nid.szInfoTitle[SIZEOF(nid.szInfoTitle) - 1] = 0;
nid.uTimeout = msn->uTimeout;
@@ -830,8 +830,8 @@ int fnCListTrayNotify(MIRANDASYSTRAYNOTIFY* msn)
nid.hWnd = cli.hwndContactList;
nid.uID = iconId;
nid.uFlags = NIF_INFO;
- lstrcpynA(nid.szInfo, msn->szInfo, sizeof(nid.szInfo));
- lstrcpynA(nid.szInfoTitle, msn->szInfoTitle, sizeof(nid.szInfoTitle));
+ mir_strncpy(nid.szInfo, msn->szInfo, sizeof(nid.szInfo));
+ mir_strncpy(nid.szInfoTitle, msn->szInfoTitle, sizeof(nid.szInfoTitle));
nid.uTimeout = msn->uTimeout;
nid.dwInfoFlags = msn->dwInfoFlags;
return Shell_NotifyIconA(NIM_MODIFY, &nid) == 0;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index ee0884e97d..b3be884dbc 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -279,9 +279,9 @@ int LoadCLUIModule(void)
RegisterClassEx(&wndclass);
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
- lstrcpyn(titleText, _T(MIRANDANAME), SIZEOF(titleText));
+ mir_tstrncpy(titleText, _T(MIRANDANAME), SIZEOF(titleText));
else {
- lstrcpyn(titleText, dbv.ptszVal, SIZEOF(titleText));
+ mir_tstrncpy(titleText, dbv.ptszVal, SIZEOF(titleText));
db_free(&dbv);
}
@@ -1009,16 +1009,16 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
else
tszName[0] = 0;
- GetTextExtentPoint32(dis->hDC, tszName, lstrlen(tszName), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, tszName, lstrlen(tszName));
+ GetTextExtentPoint32(dis->hDC, tszName, mir_tstrlen(tszName), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, tszName, mir_tstrlen(tszName));
x += textSize.cx;
}
if (showOpts & 4) {
TCHAR* szStatus = cli.pfnGetStatusModeDescription(status, 0);
if (!szStatus)
szStatus = _T("");
- GetTextExtentPoint32(dis->hDC, szStatus, lstrlen(szStatus), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, lstrlen(szStatus));
+ GetTextExtentPoint32(dis->hDC, szStatus, mir_tstrlen(szStatus), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, mir_tstrlen(szStatus));
}
}
else if (dis->CtlType == ODT_MENU) {
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp
index 50ef0e2953..2579de60bc 100644
--- a/src/modules/clist/cluiservices.cpp
+++ b/src/modules/clist/cluiservices.cpp
@@ -182,15 +182,15 @@ void fnCluiProtocolStatusChanged(int, const char*)
else
tszName[0] = 0;
- if (showOpts & 4 && lstrlen(tszName) < SIZEOF(tszName)-1)
- lstrcat(tszName, _T(" "));
- GetTextExtentPoint32(hdc, tszName, lstrlen(tszName), &textSize);
+ if (showOpts & 4 && mir_tstrlen(tszName) < SIZEOF(tszName)-1)
+ mir_tstrcat(tszName, _T(" "));
+ GetTextExtentPoint32(hdc, tszName, mir_tstrlen(tszName), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
TCHAR* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL,cli.menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
- GetTextExtentPoint32(hdc, modeDescr, lstrlen(modeDescr), &textSize);
+ GetTextExtentPoint32(hdc, modeDescr, mir_tstrlen(modeDescr), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index ddf6ffcc4d..79e461b6c4 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -454,7 +454,7 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD)
int retVal = CDRF_NEWFONT;
if (tvi.iImage == -1) {
SIZE sz;
- GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, lstrlen(tvi.pszText), &sz);
+ GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, mir_tstrlen(tvi.pszText), &sz);
RECT rc;
if (sz.cx+3 > pNMTVCD->nmcd.rc.right - pNMTVCD->nmcd.rc.left)
@@ -467,7 +467,7 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD)
SetBkColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrTextBk);
FillRect(pNMTVCD->nmcd.hdc, &rc, br);
DeleteObject(br);
- DrawText(pNMTVCD->nmcd.hdc, tvi.pszText, lstrlen(tvi.pszText), &pNMTVCD->nmcd.rc, DT_LEFT|DT_VCENTER|DT_NOPREFIX);
+ DrawText(pNMTVCD->nmcd.hdc, tvi.pszText, mir_tstrlen(tvi.pszText), &pNMTVCD->nmcd.rc, DT_LEFT|DT_VCENTER|DT_NOPREFIX);
retVal |= CDRF_SKIPDEFAULT;
}
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp
index f80dd51820..e27699662a 100644
--- a/src/modules/clist/groups.cpp
+++ b/src/modules/clist/groups.cpp
@@ -84,10 +84,10 @@ static INT_PTR CreateGroupInternal(INT_PTR iParent, const TCHAR *ptszName)
mir_sntprintf(newBaseName, SIZEOF(newBaseName), _T("%s\\%s"), dbv.ptszVal + 1, grpName);
mir_free(dbv.pszVal);
}
- else lstrcpyn(newBaseName, grpName, SIZEOF(newBaseName));
+ else mir_tstrncpy(newBaseName, grpName, SIZEOF(newBaseName));
_itoa(newId, str, 10);
- lstrcpyn(newName + 1, newBaseName, SIZEOF(newName) - 1);
+ mir_tstrncpy(newName + 1, newBaseName, SIZEOF(newName) - 1);
if (ptszName) {
i = GroupNameExists(newBaseName, -1);
if (i) newId = i - 1;
@@ -140,7 +140,7 @@ static INT_PTR GetGroupName2(WPARAM wParam, LPARAM lParam)
_itoa(wParam - 1, idstr, 10);
if (db_get_s(NULL, "CListGroups", idstr, &dbv))
return (INT_PTR) (char *) NULL;
- lstrcpynA(name, dbv.pszVal + 1, SIZEOF(name));
+ mir_strncpy(name, dbv.pszVal + 1, SIZEOF(name));
if ((DWORD *) lParam != NULL)
*(DWORD *) lParam = dbv.pszVal[0];
db_free(&dbv);
@@ -157,7 +157,7 @@ TCHAR* fnGetGroupName(int idx, DWORD* pdwFlags)
if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
return NULL;
- lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
+ mir_tstrncpy(name, dbv.ptszVal + 1, SIZEOF(name));
if (pdwFlags != NULL)
*pdwFlags = dbv.ptszVal[0];
db_free(&dbv);
@@ -185,7 +185,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
_itoa(wParam - 1, str, 10);
if (db_get_ts(NULL, "CListGroups", str, &dbv))
return 1;
- lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
+ mir_tstrncpy(name, dbv.ptszVal + 1, SIZEOF(name));
db_free(&dbv);
if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
{
@@ -197,7 +197,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
SetCursor(LoadCursor(NULL, IDC_WAIT));
//must remove setting from all child contacts too
//children are demoted to the next group up, not deleted.
- lstrcpy(szNewParent, name);
+ mir_tstrcpy(szNewParent, name);
pszLastBackslash = _tcsrchr(szNewParent, '\\');
if (pszLastBackslash)
pszLastBackslash[0] = '\0';
@@ -245,7 +245,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
TCHAR szNewName[256];
int len;
- len = lstrlen(name);
+ len = mir_tstrlen(name);
for (i=0;; i++) {
_itoa(i, str, 10);
if (db_get_ts(NULL, "CListGroups", str, &dbv))
@@ -254,7 +254,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
if (szNewParent[0])
mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2);
else
- lstrcpyn(szNewName, dbv.ptszVal + len + 2, SIZEOF(szNewName));
+ mir_tstrncpy(szNewName, dbv.ptszVal + len + 2, SIZEOF(szNewName));
cli.pfnRenameGroup(i + 1, szNewName);
}
db_free(&dbv);
@@ -286,9 +286,9 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
return 1;
str[0] = dbv.pszVal[0] & 0x7F;
- lstrcpyn(oldName, dbv.ptszVal + 1, SIZEOF(oldName));
+ mir_tstrncpy(oldName, dbv.ptszVal + 1, SIZEOF(oldName));
db_free(&dbv);
- lstrcpyn(str + 1, szName, SIZEOF(str) - 1);
+ mir_tstrncpy(str + 1, szName, SIZEOF(str) - 1);
db_set_ts(NULL, "CListGroups", idstr, str);
//must rename setting in all child contacts too
@@ -307,7 +307,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
TCHAR szNewName[256];
int len, i;
- len = lstrlen(oldName);
+ len = mir_tstrlen(oldName);
for (i=0;; i++) {
if (i == groupId)
continue;
@@ -327,7 +327,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
TCHAR *pszLastBackslash;
int i;
- lstrcpyn(str, szName, SIZEOF(str));
+ mir_tstrncpy(str, szName, SIZEOF(str));
pszLastBackslash = _tcsrchr(str, '\\');
if (pszLastBackslash != NULL) {
*pszLastBackslash = '\0';
@@ -488,11 +488,11 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
do {
pBackslash = _tcschr(pNextField, '\\');
if (pBackslash == NULL) {
- lstrcpyn(szThisField, pNextField, SIZEOF(szThisField));
+ mir_tstrncpy(szThisField, pNextField, SIZEOF(szThisField));
pNextField = NULL;
}
else {
- lstrcpyn(szThisField, pNextField, min(SIZEOF(szThisField), pBackslash - pNextField + 1));
+ mir_tstrncpy(szThisField, pNextField, min(SIZEOF(szThisField), pBackslash - pNextField + 1));
pNextField = pBackslash + 1;
}
compareResult = 1;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index d26209a8ac..76bab7ef88 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -74,7 +74,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
static bool IsInSpaceSeparatedList(const char *szWord, const char *szList)
{
const char *szItem, *szEnd;
- int wordLen = lstrlenA(szWord);
+ int wordLen = mir_strlen(szWord);
for (szItem = szList;;) {
szEnd = strchr(szItem, ' ');
@@ -111,9 +111,9 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM
warnInfo = (warnSettingChangeInfo_t*)lParam;
TranslateDialogDefault(hwndDlg);
SetDlgItemText(hwndDlg, IDC_ININAME, warnInfo->szIniPath);
- lstrcpyA(szSettingName, warnInfo->szSection);
- lstrcatA(szSettingName, " / ");
- lstrcatA(szSettingName, warnInfo->szName);
+ mir_strcpy(szSettingName, warnInfo->szSection);
+ mir_strcat(szSettingName, " / ");
+ mir_strcat(szSettingName, warnInfo->szName);
SetDlgItemTextA(hwndDlg, IDC_SETTINGNAME, szSettingName);
SetDlgItemTextA(hwndDlg, IDC_NEWVALUE, warnInfo->szValue);
if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szSafeSections))
@@ -165,7 +165,7 @@ static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM
SHFILEOPSTRUCT shfo = { 0 };
shfo.wFunc = FO_DELETE;
shfo.pFrom = szIniPath;
- szIniPath[lstrlen(szIniPath) + 1] = '\0';
+ szIniPath[mir_tstrlen(szIniPath) + 1] = '\0';
shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
@@ -229,7 +229,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
if (fgets(szLine, sizeof(szLine), fp) == NULL)
break;
LBL_NewLine:
- int lineLength = lstrlenA(szLine);
+ int lineLength = mir_strlen(szLine);
while (lineLength && (BYTE)(szLine[lineLength - 1]) <= ' ')
szLine[--lineLength] = '\0';
@@ -244,7 +244,7 @@ LBL_NewLine:
if (szLine[1] == '!')
szSection[0] = '\0';
else {
- lstrcpynA(szSection, szLine + 1, min(sizeof(szSection), (int)(szEnd - szLine)));
+ mir_strncpy(szSection, szLine + 1, min(sizeof(szSection), (int)(szEnd - szLine)));
switch (secur) {
case 0:
warnThisSection = false;
@@ -267,7 +267,7 @@ LBL_NewLine:
if (szLine[1] == '?') {
DBCONTACTENUMSETTINGS dbces;
dbces.pfnEnumProc = SettingsEnumProc;
- lstrcpynA(szSection, szLine+2, min(sizeof(szSection), (int)(szEnd-szLine-1)));
+ mir_strncpy(szSection, szLine+2, min(sizeof(szSection), (int)(szEnd-szLine-1)));
dbces.szModule = szSection;
dbces.ofsSettings = 0;
CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
@@ -292,7 +292,7 @@ LBL_NewLine:
continue;
char szName[128];
- lstrcpynA(szName, szLine, min(sizeof(szName), (int)(szValue-szLine+1)));
+ mir_strncpy(szName, szLine, min(sizeof(szName), (int)(szValue-szLine+1)));
szValue++;
{
warnSettingChangeInfo_t warnInfo;
@@ -347,7 +347,7 @@ LBL_NewLine:
case 'r': *pstr = '\r'; break;
default: *pstr = pstr[1]; break;
}
- MoveMemory(pstr + 1, pstr + 2, lstrlenA(pstr + 2) + 1);
+ MoveMemory(pstr + 1, pstr + 2, mir_strlen(pstr + 2) + 1);
}
}
case 'u':
@@ -382,7 +382,7 @@ LBL_NewLine:
int len;
char *pszValue, *pszEnd;
- PBYTE buf = (PBYTE)mir_alloc(lstrlenA(szValue + 1));
+ PBYTE buf = (PBYTE)mir_alloc(mir_strlen(szValue + 1));
for (len = 0, pszValue = szValue + 1;; len++) {
buf[len] = (BYTE)strtol(pszValue, &pszEnd, 0x10);
if (pszValue == pszEnd)
@@ -465,16 +465,16 @@ static void DoAutoExec(void)
SHFILEOPSTRUCT shfo = { 0 };
shfo.wFunc = FO_DELETE;
shfo.pFrom = szIniPath;
- szIniPath[lstrlen(szIniPath) + 1] = 0;
+ szIniPath[mir_tstrlen(szIniPath) + 1] = 0;
shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
else if (!lstrcmpi(szOnCompletion, _T("rename"))) {
TCHAR szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH];
GetPrivateProfileString(_T("AutoExec"), _T("RenamePrefix"), _T("done_"), szRenamePrefix, SIZEOF(szRenamePrefix), mirandabootini);
- lstrcpy(szNewPath, szFindPath);
- lstrcat(szNewPath, szRenamePrefix);
- lstrcat(szNewPath, fd.cFileName);
+ mir_tstrcpy(szNewPath, szFindPath);
+ mir_tstrcat(szNewPath, szRenamePrefix);
+ mir_tstrcat(szNewPath, fd.cFileName);
MoveFile(szIniPath, szNewPath);
}
else if (!lstrcmpi(szOnCompletion, _T("ask")))
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index e71d265bbe..c4ab423208 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -165,7 +165,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam)
char *buf = LPSTR(dbei->pBlob) + sizeof(DWORD);
ptrT tszFileName(getEventString(dbei, buf));
ptrT tszDescription(getEventString(dbei, buf));
- ptrT &ptszText = (lstrlen(tszDescription) == 0) ? tszFileName : tszDescription;
+ ptrT &ptszText = (mir_tstrlen(tszDescription) == 0) ? tszFileName : tszDescription;
switch (egt->datatype) {
case DBVT_WCHAR:
return (INT_PTR)ptszText.detouch();
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index 033ae492c0..f68c502ea2 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, WM_GETFONT, 0, 0));
SIZE textSize;
- GetTextExtentPoint32(hdc, TranslateT("Searching"), lstrlen(TranslateT("Searching")), &textSize);
+ GetTextExtentPoint32(hdc, TranslateT("Searching"), mir_tstrlen(TranslateT("Searching")), &textSize);
int partWidth[3];
partWidth[0] = textSize.cx;
@@ -380,7 +380,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, WM_GETFONT, 0, 0));
if (netProtoCount > 1) {
cbei.pszText = TranslateT("All networks");
- GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
+ GetTextExtentPoint32(hdc, cbei.pszText, mir_tstrlen(cbei.pszText), &textSize);
if (textSize.cx > cbwidth)
cbwidth = textSize.cx;
cbei.iImage = cbei.iSelectedImage = ImageList_AddIcon_IconLibLoaded(dat->himlComboIcons, SKINICON_OTHER_SEARCHALL);
@@ -399,7 +399,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
continue;
cbei.pszText = pa->tszAccountName;
- GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
+ GetTextExtentPoint32(hdc, cbei.pszText, mir_tstrlen(cbei.pszText), &textSize);
if (textSize.cx > cbwidth)
cbwidth = textSize.cx;
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index 19f8eae9cb..4386af1143 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -202,7 +202,7 @@ static void BeginSearchFailed(void * arg)
protoName, protoName);
mir_free((char*)arg);
}
- else lstrcpyn(buf, TranslateT("Could not search on any of the protocols, are you online?"), SIZEOF(buf));
+ else mir_tstrncpy(buf, TranslateT("Could not search on any of the protocols, are you online?"), SIZEOF(buf));
MessageBox(0, buf, TranslateT("Problem with search"), MB_OK | MB_ICONERROR);
}
@@ -258,17 +258,17 @@ void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat)
if (dat->searchCount != 0) {
int i;
- lstrcpy(str, TranslateT("Searching"));
+ mir_tstrcpy(str, TranslateT("Searching"));
for (i=0; i < dat->searchCount; i++) {
PROTOACCOUNT *pa = Proto_GetAccount(dat->search[i].szProto);
if (!pa)
continue;
- lstrcat(str, i ? _T(", ") : _T(" "));
- lstrcat(str, pa->tszAccountName);
+ mir_tstrcat(str, i ? _T(", ") : _T(" "));
+ mir_tstrcat(str, pa->tszAccountName);
}
}
- else lstrcpy(str, TranslateT("Idle"));
+ else mir_tstrcpy(str, TranslateT("Idle"));
SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)str);
}
@@ -322,16 +322,16 @@ void SetStatusBarResultInfo(HWND hwndDlg)
if (i) {
if ((pa = Proto_GetAccount(subtotal[i].szProto)) == NULL)
return;
- lstrcat(str, _T(", "));
+ mir_tstrcat(str, _T(", "));
}
mir_sntprintf(substr, SIZEOF(substr), _T("%d %s"), subtotal[i].count, pa->tszAccountName);
- lstrcat(str, substr);
+ mir_tstrcat(str, substr);
}
- lstrcat(str, _T(")"));
+ mir_tstrcat(str, _T(")"));
}
mir_free(subtotal);
}
- else lstrcpy(str, TranslateT("No users found"));
+ else mir_tstrcpy(str, TranslateT("No users found"));
SendMessage(hwndStatus, SB_SETTEXT, 2, (LPARAM)str);
}
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index e90f2cac8f..aad063d484 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -347,7 +347,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName,
int sectionLevel = 0;
HTREEITEM hSection = NULL;
- lstrcpy(itemName, groupName);
+ mir_tstrcpy(itemName, groupName);
sectionName = itemName;
while (sectionName) {
@@ -751,7 +751,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
hoFont = (HFONT) SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, mis->CtlID, WM_GETFONT, 0, 0));
SIZE fontSize;
- GetTextExtentPoint32(hdc, itemName, lstrlen(itemName), &fontSize);
+ GetTextExtentPoint32(hdc, itemName, mir_tstrlen(itemName), &fontSize);
if (hoFont) SelectObject(hdc, hoFont);
if (hFont) DeleteObject(hFont);
ReleaseDC( GetDlgItem(hwndDlg, mis->CtlID), hdc);
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index 56b3300ede..9a46c10e37 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -306,7 +306,7 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack)
if (!lstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) {
LOGFONT lf;
SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, FALSE);
- lstrcpyn(newItem->deffontsettings.szFace, lf.lfFaceName, SIZEOF(newItem->deffontsettings.szFace));
+ mir_tstrncpy(newItem->deffontsettings.szFace, lf.lfFaceName, SIZEOF(newItem->deffontsettings.szFace));
if (!newItem->deffontsettings.size)
newItem->deffontsettings.size = lf.lfHeight;
}
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index 35e77a8e37..6a1b5ff9f0 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -353,7 +353,7 @@ IconSourceItem* GetIconSourceItemFromPath(const TCHAR* path, int cxIcon, int cyI
return NULL;
TCHAR file[ MAX_PATH ];
- lstrcpyn(file, path, SIZEOF(file));
+ mir_tstrncpy(file, path, SIZEOF(file));
TCHAR *comma = _tcsrchr(file, ',');
int n;
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp
index c914501951..f3b538f6b3 100644
--- a/src/modules/icolib/skin2opts.cpp
+++ b/src/modules/icolib/skin2opts.cpp
@@ -49,7 +49,7 @@ static HICON ExtractIconFromPath(const TCHAR *path, int cxIcon, int cyIcon)
if (!path)
return (HICON)NULL;
- lstrcpyn(file, path, SIZEOF(file));
+ mir_tstrncpy(file, path, SIZEOF(file));
comma = _tcsrchr(file, ',');
if (!comma)
n = 0;
@@ -150,7 +150,7 @@ static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive)
{
TCHAR path[ MAX_PATH ];
mir_sntprintf(path, SIZEOF(path), _T("%s,"), filename);
- int suffIndx = lstrlen(path);
+ int suffIndx = mir_tstrlen(path);
mir_cslock lck(csIconList);
@@ -259,29 +259,29 @@ static TCHAR* OpenFileDlg(HWND hParent, const TCHAR* szFile, BOOL bAll)
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hParent;
- lstrcpy(filter, TranslateT("Icon sets"));
+ mir_tstrcpy(filter, TranslateT("Icon sets"));
if (bAll)
- lstrcat(filter, _T(" (*.dll;*.icl;*.exe;*.ico)"));
+ mir_tstrcat(filter, _T(" (*.dll;*.icl;*.exe;*.ico)"));
else
- lstrcat(filter, _T(" (*.dll)"));
+ mir_tstrcat(filter, _T(" (*.dll)"));
- pfilter = filter+lstrlen(filter)+1;
+ pfilter = filter+mir_tstrlen(filter)+1;
if (bAll)
- lstrcpy(pfilter, _T("*.DLL;*.ICL;*.EXE;*.ICO"));
+ mir_tstrcpy(pfilter, _T("*.DLL;*.ICL;*.EXE;*.ICO"));
else
- lstrcpy(pfilter, _T("*.DLL"));
-
- pfilter += lstrlen(pfilter) + 1;
- lstrcpy(pfilter, TranslateT("All files"));
- lstrcat(pfilter, _T(" (*)"));
- pfilter += lstrlen(pfilter) + 1;
- lstrcpy(pfilter, _T("*"));
- pfilter += lstrlen(pfilter) + 1;
+ mir_tstrcpy(pfilter, _T("*.DLL"));
+
+ pfilter += mir_tstrlen(pfilter) + 1;
+ mir_tstrcpy(pfilter, TranslateT("All files"));
+ mir_tstrcat(pfilter, _T(" (*)"));
+ pfilter += mir_tstrlen(pfilter) + 1;
+ mir_tstrcpy(pfilter, _T("*"));
+ pfilter += mir_tstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrDefExt = _T("dll");
- lstrcpyn(file, szFile, SIZEOF(file));
+ mir_tstrncpy(file, szFile, SIZEOF(file));
ofn.lpstrFile = file;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
ofn.nMaxFile = MAX_PATH*2;
@@ -707,7 +707,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
int sectionLevel = 0;
hSection = NULL;
- lstrcpy(itemName, sectionList[indx]->name);
+ mir_tstrcpy(itemName, sectionList[indx]->name);
sectionName = itemName;
while (sectionName) {
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp
index 30f9f1dcf7..f6110cbbdf 100644
--- a/src/modules/langpack/langpack.cpp
+++ b/src/modules/langpack/langpack.cpp
@@ -47,7 +47,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam)
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
/* get data */
PathToAbsoluteT(_T("\\Languages\\"), tszFullPath);
- lstrcat(tszFullPath, wfd.cFileName);
+ mir_tstrcat(tszFullPath, wfd.cFileName);
LANGPACK_INFO pack;
if (!LoadLangPackDescr(tszFullPath, &pack)) {
@@ -69,14 +69,14 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam)
if (callback != NULL) {
LANGPACK_INFO pack;
pack.Locale = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
- lstrcpy(pack.tszLanguage, _T("English"));
+ mir_tstrcpy(pack.tszLanguage, _T("English"));
pack.szAuthors = "Miranda NG Development Team";
pack.szAuthorEmail = "project-info@miranda-ng.org";
DWORD v = CallService(MS_SYSTEM_GETVERSION, 0, 0);
pack.szLastModifiedUsing.Format("%d.%d.%d", ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF));
/* file date */
if (GetModuleFileName(NULL, pack.tszFullPath, SIZEOF(pack.tszFullPath))) {
- lstrcpy(pack.tszFileName, _T("default"));
+ mir_tstrcpy(pack.tszFileName, _T("default"));
HANDLE hFile = CreateFile(pack.tszFileName, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (hFile != INVALID_HANDLE_VALUE) {
GetFileTime(hFile, NULL, NULL, &pack.ftFileDate);
diff --git a/src/modules/langpack/lpopts.cpp b/src/modules/langpack/lpopts.cpp
index 29cf41df41..7b960b6a40 100644
--- a/src/modules/langpack/lpopts.cpp
+++ b/src/modules/langpack/lpopts.cpp
@@ -47,8 +47,8 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack)
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
TCHAR *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
- szLocaleName[SIZEOF(szLocaleName) - lstrlen(pszIncompat) - 1] = 0;
- lstrcat(lstrcat(szLocaleName, _T(" ")), pszIncompat);
+ szLocaleName[SIZEOF(szLocaleName) - mir_tstrlen(pszIncompat) - 1] = 0;
+ mir_tstrcat(mir_tstrcat(szLocaleName, _T(" ")), pszIncompat);
}
SetDlgItemText(hwndDlg, IDC_LANGLOCALE, szLocaleName);
}
@@ -124,7 +124,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_LANGEMAIL:
{
char buf[512];
- lstrcpyA(buf, "mailto:");
+ mir_strcpy(buf, "mailto:");
if (GetWindowTextA(GetDlgItem(hwndDlg, LOWORD(wParam)), &buf[7], SIZEOF(buf)-7))
CallService(MS_UTILS_OPENURL, FALSE, (LPARAM)buf);
}
@@ -167,7 +167,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
LANGPACK_INFO *pack = (LANGPACK_INFO*)ComboBox_GetItemData(hwndList, i);
if (i == idx) {
db_set_ts(NULL, "Langpack", "Current", pack->tszFileName);
- lstrcpy(tszPath, pack->tszFullPath);
+ mir_tstrcpy(tszPath, pack->tszFullPath);
pack->flags |= LPF_ENABLED;
}
else pack->flags &= ~LPF_ENABLED;
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp
index 87e1278f86..b7a529853b 100644
--- a/src/modules/netlib/netlibhttp.cpp
+++ b/src/modules/netlib/netlibhttp.cpp
@@ -1117,7 +1117,7 @@ next:
if (chunked) {
nlhrReply->headers[chunkhdr].szName = (char*)mir_realloc(nlhrReply->headers[chunkhdr].szName, 16);
- lstrcpyA(nlhrReply->headers[chunkhdr].szName, "Content-Length");
+ mir_strcpy(nlhrReply->headers[chunkhdr].szName, "Content-Length");
nlhrReply->headers[chunkhdr].szValue = (char*)mir_realloc(nlhrReply->headers[chunkhdr].szValue, 16);
mir_snprintf(nlhrReply->headers[chunkhdr].szValue, 16, "%u", nlhrReply->dataLength);
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp
index 330e8e3588..482aa33200 100644
--- a/src/modules/netlib/netliblog.cpp
+++ b/src/modules/netlib/netliblog.cpp
@@ -65,7 +65,7 @@ static void InitLog()
}
ptrT szBuf(db_get_tsa(NULL, "Netlib", "File"));
- if (lstrlen(szBuf)) {
+ if (mir_tstrlen(szBuf)) {
logOptions.tszUserFile = szBuf;
TCHAR path[MAX_PATH];
@@ -172,9 +172,9 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
}
_tcscpy(filter, TranslateT("All files"));
_tcscat(filter, _T(" (*)"));
- TCHAR *pfilter = filter + lstrlen(filter) + 1;
+ TCHAR *pfilter = filter + mir_tstrlen(filter) + 1;
_tcscpy(pfilter, _T("*"));
- pfilter = pfilter + lstrlen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
@@ -189,7 +189,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str, ' ') != NULL) {
MoveMemory(str + 1, str, ((SIZEOF(str) - 2) * sizeof(TCHAR)));
str[0] = '"';
- lstrcat(str, _T("\""));
+ mir_tstrcat(str, _T("\""));
}
SetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str);
}
@@ -466,7 +466,7 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla
pszBuf += wsprintfA(pszBuf, "%02X%c", buf[line + col], ((col & 3) == 3 && col != 15) ? '-' : ' '); //!!!!!!!!!!
// Fill out last line with blanks
for (; col < 16; col++) {
- lstrcpyA(pszBuf, " ");
+ mir_strcpy(pszBuf, " ");
pszBuf += 3;
}
*pszBuf++ = ' ';
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp
index 79603015bd..100b7341c0 100644
--- a/src/modules/netlib/netlibopenconn.cpp
+++ b/src/modules/netlib/netlibopenconn.cpp
@@ -185,8 +185,8 @@ static int NetlibInitSocks5Connection(NetlibConnection *nlc, NetlibUser *nlu, NE
int nUserLen, nPassLen;
PBYTE pAuthBuf;
- nUserLen = lstrlenA(nlu->settings.szProxyAuthUser);
- nPassLen = lstrlenA(nlu->settings.szProxyAuthPassword);
+ nUserLen = mir_strlen(nlu->settings.szProxyAuthUser);
+ nPassLen = mir_strlen(nlu->settings.szProxyAuthPassword);
pAuthBuf = (PBYTE)mir_alloc(3+nUserLen+nPassLen);
pAuthBuf[0] = 1; //auth version
pAuthBuf[1] = nUserLen;
@@ -218,7 +218,7 @@ static int NetlibInitSocks5Connection(NetlibConnection *nlc, NetlibUser *nlu, NE
if (nlc->dnsThroughProxy) {
hostIP = inet_addr(nloc->szHost);
if (hostIP == INADDR_NONE)
- nHostLen = lstrlenA(nloc->szHost)+1;
+ nHostLen = mir_strlen(nloc->szHost)+1;
else nHostLen = 4;
}
else {
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp
index 404453c2d4..46fb1d0e06 100644
--- a/src/modules/netlib/netlibsecurity.cpp
+++ b/src/modules/netlib/netlibsecurity.cpp
@@ -331,11 +331,11 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
const TCHAR* loginName = login;
const TCHAR* domainName = _tcschr(login, '\\');
int domainLen = 0;
- int loginLen = lstrlen(loginName);
+ int loginLen = mir_tstrlen(loginName);
if (domainName != NULL)
{
loginName = domainName + 1;
- loginLen = lstrlen(loginName);
+ loginLen = mir_tstrlen(loginName);
domainLen = domainName - login;
domainName = login;
}
@@ -343,13 +343,13 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
{
loginName = login;
loginLen = domainName - login;
- domainLen = lstrlen(++domainName);
+ domainLen = mir_tstrlen(++domainName);
}
auth.User = (PWORD)loginName;
auth.UserLength = loginLen;
auth.Password = (PWORD)psw;
- auth.PasswordLength = lstrlen(psw);
+ auth.PasswordLength = mir_tstrlen(psw);
auth.Domain = (PWORD)domainName;
auth.DomainLength = domainLen;
auth.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
diff --git a/src/modules/options/descbutton.cpp b/src/modules/options/descbutton.cpp
index 2e818ec135..d50f634d52 100644
--- a/src/modules/options/descbutton.cpp
+++ b/src/modules/options/descbutton.cpp
@@ -194,7 +194,7 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg
textRect.top = DBC_BORDER_SIZE;
textRect.bottom = dat->height - DBC_BORDER_SIZE;
DrawText(tempDC, dat->lpzTitle, -1, &textRect, DT_TOP|DT_LEFT|DT_END_ELLIPSIS);
- GetTextExtentPoint32(tempDC, dat->lpzTitle, lstrlen(dat->lpzTitle), &titleSize);
+ GetTextExtentPoint32(tempDC, dat->lpzTitle, mir_tstrlen(dat->lpzTitle), &titleSize);
DeleteObject(SelectObject(tempDC, hfntSave));
}
@@ -206,7 +206,7 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg
textRect.top = DBC_BORDER_SIZE + titleSize.cy ? titleSize.cy + DBC_HSPACING : 0;
textRect.bottom = dat->height - DBC_BORDER_SIZE;
DrawText(tempDC, dat->lpzDescription, -1, &textRect, DT_TOP|DT_LEFT|DT_WORDBREAK|DT_END_ELLIPSIS);
- GetTextExtentPoint32(tempDC, dat->lpzTitle, lstrlen(dat->lpzTitle), &titleSize);
+ GetTextExtentPoint32(tempDC, dat->lpzTitle, mir_tstrlen(dat->lpzTitle), &titleSize);
}
SelectObject(tempDC, hfntSave);
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index 2b299fba2a..85bdd336c4 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -529,7 +529,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case IDC_PLUGINURL:
char buf[512];
char *p = &buf[7];
- lstrcpyA(buf, "mailto:");
+ mir_strcpy(buf, "mailto:");
if (GetDlgItemTextA(hwndDlg, LOWORD(wParam), p, SIZEOF(buf) - 7))
CallService(MS_UTILS_OPENURL, 0, (LPARAM)(LOWORD(wParam) == IDC_PLUGINEMAIL ? buf : p));
break;
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 4067068cad..7ffec4f215 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -373,7 +373,7 @@ static INT_PTR stub33(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
static INT_PTR stub41(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
{
- lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam);
+ mir_strncpy((char*)lParam, ppi->m_szModuleName, wParam);
return 0;
}
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 4cd162a278..ed8af42f0f 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -488,7 +488,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((char*)lParam));
return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam);
case 34: return (INT_PTR)ppi->UserIsTyping(wParam, lParam);
- case 35: lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam); return 0;
+ case 35: mir_strncpy((char*)lParam, ppi->m_szModuleName, wParam); return 0;
case 36: return ppi->m_iStatus;
case 100:
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 4b5c6eba6d..1024e945df 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -71,7 +71,7 @@ PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBasePr
pa->szProtoName = mir_strdup(szBaseProto);
// if the internal name is empty, generate new one
- if (lstrlenA(szModuleName) == 0) {
+ if (mir_strlen(szModuleName) == 0) {
char buf[100];
int count = 1;
while (true) {
@@ -109,7 +109,7 @@ struct AccFormDlgParam
static bool FindAccountByName(const char *szModuleName)
{
- if (!lstrlenA(szModuleName))
+ if (!mir_strlen(szModuleName))
return false;
for (int i = 0; i < accounts.getCount(); i++)
@@ -620,7 +620,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
if (lps->itemID == (unsigned)dat->iSelected) {
SelectObject(lps->hDC, dat->hfntText);
mir_sntprintf(text, size, _T("%s: %S"), TranslateT("Protocol"), acc->szProtoName);
- length = lstrlen(text);
+ length = mir_tstrlen(text);
DrawText(lps->hDC, text, -1, &lps->rcItem, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
GetTextExtentPoint32(lps->hDC, text, length, &sz);
lps->rcItem.top += sz.cy + 2;
@@ -653,7 +653,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
}
else mir_sntprintf(text, size, TranslateT("Protocol is not loaded."));
- length = lstrlen(text);
+ length = mir_tstrlen(text);
DrawText(lps->hDC, text, -1, &lps->rcItem, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
GetTextExtentPoint32(lps->hDC, text, length, &sz);
lps->rcItem.top += sz.cy + 2;
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp
index bd450805b8..2b5f8ac7f3 100644
--- a/src/modules/skin/hotkey_opts.cpp
+++ b/src/modules/skin/hotkey_opts.cpp
@@ -414,8 +414,8 @@ static void sttOptionsStartEdit(HWND hwndDlg, HWND hwndHotkey)
static void sttOptionsDrawTextChunk(HDC hdc, TCHAR *text, RECT *rc)
{
SIZE sz;
- DrawText(hdc, text, lstrlen(text), rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
- GetTextExtentPoint32(hdc, text, lstrlen(text), &sz);
+ DrawText(hdc, text, mir_tstrlen(text), rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
+ GetTextExtentPoint32(hdc, text, mir_tstrlen(text), &sz);
rc->left += sz.cx;
}
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp
index 1c9f86a48d..47ef5b7178 100644
--- a/src/modules/utils/bmpfilter.cpp
+++ b/src/modules/utils/bmpfilter.cpp
@@ -41,7 +41,7 @@ static INT_PTR sttBitmapLoader(const TCHAR* ptszFileName)
if (!PathToAbsoluteT(ptszFileName, szFilename))
mir_sntprintf(szFilename, SIZEOF(szFilename), _T("%s"), ptszFileName);
- int filenameLen = lstrlen(szFilename);
+ int filenameLen = mir_tstrlen(szFilename);
if (filenameLen > 4) {
TCHAR* pszExt = szFilename + filenameLen - 4;
@@ -143,41 +143,41 @@ static INT_PTR BmpFilterGetStrings(WPARAM wParam, LPARAM lParam)
int bytesLeft = wParam;
char *filter = (char*)lParam, *pfilter;
- lstrcpynA(filter, Translate("All bitmaps"), bytesLeft); bytesLeft-=lstrlenA(filter);
+ mir_strncpy(filter, Translate("All bitmaps"), bytesLeft); bytesLeft-=mir_strlen(filter);
strncat(filter, " (*.bmp;*.jpg;*.gif;*.png)", bytesLeft);
- pfilter = filter+lstrlenA(filter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, "*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter = filter+mir_strlen(filter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_strncpy(pfilter, "*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG", bytesLeft);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, Translate("Windows bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ mir_strncpy(pfilter, Translate("Windows bitmaps"), bytesLeft); bytesLeft-=mir_strlen(pfilter);
strncat(pfilter, " (*.bmp;*.rle)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, "*.BMP;*.RLE", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_strncpy(pfilter, "*.BMP;*.RLE", bytesLeft);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, Translate("JPEG bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ mir_strncpy(pfilter, Translate("JPEG bitmaps"), bytesLeft); bytesLeft-=mir_strlen(pfilter);
strncat(pfilter, " (*.jpg;*.jpeg)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, "*.JPG;*.JPEG", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_strncpy(pfilter, "*.JPG;*.JPEG", bytesLeft);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, Translate("GIF bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ mir_strncpy(pfilter, Translate("GIF bitmaps"), bytesLeft); bytesLeft-=mir_strlen(pfilter);
strncat(pfilter, " (*.gif)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, "*.GIF", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_strncpy(pfilter, "*.GIF", bytesLeft);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, Translate("PNG bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ mir_strncpy(pfilter, Translate("PNG bitmaps"), bytesLeft); bytesLeft-=mir_strlen(pfilter);
strncat(pfilter, " (*.png)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, "*.PNG", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_strncpy(pfilter, "*.PNG", bytesLeft);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, Translate("All files"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ mir_strncpy(pfilter, Translate("All files"), bytesLeft); bytesLeft-=mir_strlen(pfilter);
strncat(pfilter, " (*)", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpynA(pfilter, "*", bytesLeft);
- pfilter+=lstrlenA(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_strncpy(pfilter, "*", bytesLeft);
+ pfilter+=mir_strlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
if (bytesLeft) *pfilter = '\0';
return 0;
@@ -188,41 +188,41 @@ static INT_PTR BmpFilterGetStringsW(WPARAM wParam, LPARAM lParam)
int bytesLeft = wParam;
TCHAR *filter = (TCHAR*)lParam, *pfilter;
- lstrcpyn(filter, TranslateT("All bitmaps"), bytesLeft); bytesLeft-=lstrlen(filter);
+ mir_tstrncpy(filter, TranslateT("All bitmaps"), bytesLeft); bytesLeft-=mir_tstrlen(filter);
_tcsncat(filter, _T(" (*.bmp;*.jpg;*.gif;*.png)"), bytesLeft);
- pfilter = filter+lstrlen(filter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, _T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter = filter+mir_tstrlen(filter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_tstrncpy(pfilter, _T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"), bytesLeft);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, TranslateT("Windows bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ mir_tstrncpy(pfilter, TranslateT("Windows bitmaps"), bytesLeft); bytesLeft-=mir_tstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.bmp;*.rle)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, _T("*.BMP;*.RLE"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_tstrncpy(pfilter, _T("*.BMP;*.RLE"), bytesLeft);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, TranslateT("JPEG bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ mir_tstrncpy(pfilter, TranslateT("JPEG bitmaps"), bytesLeft); bytesLeft-=mir_tstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.jpg;*.jpeg)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, _T("*.JPG;*.JPEG"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_tstrncpy(pfilter, _T("*.JPG;*.JPEG"), bytesLeft);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, TranslateT("GIF bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ mir_tstrncpy(pfilter, TranslateT("GIF bitmaps"), bytesLeft); bytesLeft-=mir_tstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.gif)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, _T("*.GIF"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_tstrncpy(pfilter, _T("*.GIF"), bytesLeft);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, TranslateT("PNG bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ mir_tstrncpy(pfilter, TranslateT("PNG bitmaps"), bytesLeft); bytesLeft-=mir_tstrlen(pfilter);
_tcsncat(pfilter, _T(" (*.png)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, _T("*.PNG"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_tstrncpy(pfilter, _T("*.PNG"), bytesLeft);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, TranslateT("All files"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ mir_tstrncpy(pfilter, TranslateT("All files"), bytesLeft); bytesLeft-=mir_tstrlen(pfilter);
_tcsncat(pfilter, _T(" (*)"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
- lstrcpyn(pfilter, _T("*"), bytesLeft);
- pfilter+=lstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
+ mir_tstrncpy(pfilter, _T("*"), bytesLeft);
+ pfilter+=mir_tstrlen(pfilter)+1; bytesLeft = wParam-(pfilter-filter);
if (bytesLeft) *pfilter = '\0';
return 0;
diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp
index 7eaba363de..9f075a7514 100644
--- a/src/modules/utils/hyperlink.cpp
+++ b/src/modules/utils/hyperlink.cpp
@@ -165,7 +165,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
if (hdc == NULL) return 0; /* text change failed */
if (dat->hEnableFont != NULL) hPrevFont = (HFONT)SelectObject(hdc, dat->hEnableFont);
if (dat->hEnableFont == NULL || hPrevFont != NULL) /* select failed? */
- if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, lstrlen((TCHAR*)lParam), &textSize))
+ if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, mir_tstrlen((TCHAR*)lParam), &textSize))
if (GetClientRect(hwnd, &rc)) {
dat->rcText.top = 0;
dat->rcText.bottom = dat->rcText.top+textSize.cy;
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp
index a4722f804f..7228182874 100644
--- a/src/modules/utils/openurl.cpp
+++ b/src/modules/utils/openurl.cpp
@@ -38,7 +38,7 @@ static void OpenURLThread(void *arg)
return;
//wack a protocol on it
- size_t size = lstrlen(hUrlInfo->szUrl)+9;
+ size_t size = mir_tstrlen(hUrlInfo->szUrl)+9;
TCHAR *szResult = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') {
mir_sntprintf(szResult, size, _T("file:///%s"), hUrlInfo->szUrl);