summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
commitb7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch)
tree468d9610a590685322ad2159a9bd2d9e2ba83f89
parent7de513f180c429859e246d1033d745b394e1fc28 (diff)
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_core.h31
-rw-r--r--plugins/Alarms/src/alarm_win.cpp2
-rw-r--r--plugins/Alarms/src/alarmlist.cpp78
-rw-r--r--plugins/AssocMgr/src/assoclist.cpp16
-rw-r--r--plugins/AvatarHistory/src/utils.cpp2
-rw-r--r--plugins/BasicHistory/src/Options.cpp154
-rw-r--r--plugins/CSList/src/cslist.cpp2
-rw-r--r--plugins/Clist_blind/src/cluiopts.cpp4
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistopts.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_log.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_newrowopts.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp46
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp52
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp4
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp2
-rw-r--r--plugins/Clist_nicer/src/clui.cpp6
-rw-r--r--plugins/Clist_nicer/src/cluiopts.cpp4
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp56
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp48
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp28
-rw-r--r--plugins/CrashDumper/src/exhndlr.cpp2
-rw-r--r--plugins/CrashDumper/src/upload.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbcontacts.cpp4
-rw-r--r--plugins/DbEditorPP/src/addeditsettingsdlg.cpp2
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp2
-rw-r--r--plugins/DbEditorPP/src/findwindow.cpp6
-rw-r--r--plugins/DbEditorPP/src/settinglist.cpp6
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp2
-rw-r--r--plugins/Db_autobackups/src/backup.cpp2
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp2
-rw-r--r--plugins/FTPFileYM/src/job_delete.cpp8
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp20
-rw-r--r--plugins/FTPFileYM/src/manager.cpp2
-rw-r--r--plugins/FTPFileYM/src/mir_db.cpp22
-rw-r--r--plugins/FTPFileYM/src/serverlist.cpp2
-rw-r--r--plugins/FTPFileYM/src/utils.cpp4
-rw-r--r--plugins/FavContacts/src/http_api.cpp2
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp4
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp16
-rw-r--r--plugins/HTTPServer/src/main.cpp2
-rw-r--r--plugins/IEView/src/ChatHTMLBuilder.cpp10
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp4
-rw-r--r--plugins/IEView/src/HistoryHTMLBuilder.cpp14
-rw-r--r--plugins/IEView/src/MUCCHTMLBuilder.cpp10
-rw-r--r--plugins/IEView/src/ScriverHTMLBuilder.cpp10
-rw-r--r--plugins/IEView/src/TabSRMMHTMLBuilder.cpp10
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp4
-rw-r--r--plugins/LotusNotify/src/LotusNotify.cpp4
-rw-r--r--plugins/MenuItemEx/src/main.cpp4
-rw-r--r--plugins/MirOTR/src/utils.cpp2
-rwxr-xr-xplugins/Msg_Export/src/options.cpp2
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp6
-rw-r--r--plugins/NewXstatusNotify/src/options.cpp16
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.cpp8
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp24
-rw-r--r--plugins/NewsAggregator/Src/Authentication.cpp2
-rw-r--r--plugins/Non-IM Contact/src/contactinfo.cpp20
-rw-r--r--plugins/Non-IM Contact/src/files.cpp36
-rw-r--r--plugins/Non-IM Contact/src/namereplacing.cpp2
-rw-r--r--plugins/Non-IM Contact/src/timer.cpp4
-rw-r--r--plugins/NotesAndReminders/src/options.cpp2
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp16
-rw-r--r--plugins/Nudge/src/main.cpp2
-rw-r--r--plugins/PackUpdater/Src/Options.cpp12
-rw-r--r--plugins/Ping/src/pinggraph.cpp16
-rw-r--r--plugins/Ping/src/pinglist.cpp6
-rw-r--r--plugins/Ping/src/rawping.cpp2
-rw-r--r--plugins/Ping/src/utils.cpp14
-rw-r--r--plugins/PluginUpdater/src/Notifications.cpp2
-rw-r--r--plugins/PluginUpdater/src/Options.cpp8
-rw-r--r--plugins/Popup/src/font.cpp4
-rw-r--r--plugins/Popup/src/notifications.cpp28
-rw-r--r--plugins/Popup/src/opt_class.cpp20
-rw-r--r--plugins/Popup/src/services.cpp4
-rw-r--r--plugins/Popup/src/skin.cpp6
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp4
-rw-r--r--plugins/RecentContacts/src/options.cpp2
-rw-r--r--plugins/RemovePersonalSettings/src/rps.cpp4
-rw-r--r--plugins/Scriver/src/msgdialog.cpp2
-rw-r--r--plugins/Scriver/src/msgoptions.cpp20
-rw-r--r--plugins/SecureIM/src/options.cpp2
-rw-r--r--plugins/SecureIM/src/svcs_rsa.cpp2
-rw-r--r--plugins/SeenPlugin/src/options.cpp4
-rw-r--r--plugins/SeenPlugin/src/utils.cpp8
-rw-r--r--plugins/Sessions/Src/Main.cpp4
-rw-r--r--plugins/Sessions/Src/Utils.cpp10
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp70
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp38
-rw-r--r--plugins/SimpleStatusMsg/src/options.cpp66
-rw-r--r--plugins/SimpleStatusMsg/src/utils.cpp8
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp2
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp12
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/options.cpp12
-rw-r--r--plugins/StatusPlugins/StartupStatus/options.cpp6
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp4
-rw-r--r--plugins/StatusPlugins/StartupStatus/startupstatus.cpp4
-rw-r--r--plugins/StatusPlugins/StartupStatus/toolbars.cpp4
-rw-r--r--plugins/StatusPlugins/confirmdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp18
-rw-r--r--plugins/TabSRMM/src/container.cpp12
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp2
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
-rw-r--r--plugins/TabSRMM/src/themeio.cpp30
-rw-r--r--plugins/TipperYM/src/options.cpp56
-rw-r--r--plugins/TipperYM/src/subst.cpp4
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp6
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp8
-rw-r--r--plugins/UserInfoEx/src/ex_import/tinyxml.cpp10
-rw-r--r--plugins/UserInfoEx/src/svc_contactinfo.cpp2
-rw-r--r--plugins/Variables/src/help.cpp4
-rw-r--r--plugins/WhenWasIt/src/icons.cpp2
-rw-r--r--plugins/WhenWasIt/src/utils.cpp4
-rw-r--r--plugins/XSoundNotify/src/xsn_main.cpp2
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp6
-rw-r--r--plugins/YAMN/src/proto/netlib.cpp2
-rw-r--r--plugins/YAPP/src/options.cpp10
-rw-r--r--plugins/YAPP/src/services.cpp6
-rw-r--r--plugins/YahooGroups/src/services.cpp6
-rw-r--r--plugins/YahooGroups/src/utils.cpp4
-rw-r--r--protocols/FacebookRM/src/events.cpp12
-rw-r--r--protocols/FacebookRM/src/proto.cpp24
-rw-r--r--protocols/GTalkExt/src/avatar.cpp2
-rw-r--r--protocols/GTalkExt/src/handlers.cpp4
-rw-r--r--protocols/GTalkExt/src/inbox.cpp4
-rw-r--r--protocols/GTalkExt/src/notifications.cpp6
-rw-r--r--protocols/GTalkExt/src/options.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp2
-rw-r--r--protocols/IRCG/src/irclib.cpp6
-rw-r--r--protocols/IcqOscarJ/src/editstring.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_13servclist.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp14
-rw-r--r--protocols/IcqOscarJ/src/log.cpp2
-rw-r--r--protocols/IcqOscarJ/src/userinfotab.cpp6
-rw-r--r--protocols/JabberG/src/jabber_console.cpp2
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp30
-rw-r--r--protocols/JabberG/src/jabber_file.cpp2
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp16
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp6
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp4
-rw-r--r--protocols/JabberG/src/jabber_util.cpp6
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp44
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp30
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp2
-rw-r--r--protocols/MSN/src/msn_contact.cpp6
-rw-r--r--protocols/MSN/src/msn_mail.cpp4
-rw-r--r--protocols/MSN/src/msn_misc.cpp20
-rw-r--r--protocols/MSN/src/msn_soapab.cpp2
-rw-r--r--protocols/Omegle/src/communication.cpp8
-rw-r--r--protocols/Sametime/src/userlist.cpp16
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp12
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp2
-rw-r--r--protocols/Tlen/src/tlen_muc.cpp2
-rw-r--r--protocols/Tlen/src/tlen_p2p_old.cpp6
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp2
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp4
-rw-r--r--protocols/Tox/src/tox_multimedia.cpp2
-rw-r--r--protocols/Tox/src/tox_network.cpp8
-rw-r--r--protocols/Tox/src/tox_options.cpp24
-rw-r--r--protocols/Twitter/src/ui.cpp6
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp50
-rw-r--r--protocols/Xfire/src/SHA1.cpp8
-rw-r--r--protocols/Xfire/src/clientloginpacket.cpp4
-rw-r--r--protocols/Xfire/src/tools.cpp4
-rw-r--r--protocols/Yahoo/src/util.cpp2
-rw-r--r--protocols/Yahoo/src/yahoo.h7
-rw-r--r--src/core/stdaway/src/sendmsg.cpp2
-rw-r--r--src/core/stdchat/src/options.cpp2
-rw-r--r--src/core/stdchat/src/tools.cpp10
-rw-r--r--src/core/stdclist/src/clcfonts.cpp2
-rw-r--r--src/core/stdclist/src/cluiopts.cpp4
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp8
-rw-r--r--src/core/stdfile/src/filesenddlg.cpp2
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp12
-rw-r--r--src/core/stduserinfo/src/contactinfo.cpp16
-rw-r--r--src/core/stduserinfo/src/stdinfo.cpp14
-rw-r--r--src/mir_core/src/db.cpp2
-rw-r--r--src/mir_core/src/icons.cpp4
-rw-r--r--src/mir_core/src/path.cpp2
-rw-r--r--src/modules/chat/chat_opts.cpp12
-rw-r--r--src/modules/chat/log.cpp12
-rw-r--r--src/modules/clist/clcutils.cpp10
-rw-r--r--src/modules/clist/clistmenus.cpp16
-rw-r--r--src/modules/clist/contacts.cpp4
-rw-r--r--src/modules/clist/genmenuopt.cpp16
-rw-r--r--src/modules/extraicons/extraicons.cpp10
-rw-r--r--src/modules/extraicons/options_ei.cpp22
-rw-r--r--src/modules/findadd/searchresults.cpp8
-rw-r--r--src/modules/fonts/FontOptions.cpp26
-rw-r--r--src/modules/fonts/services.cpp18
-rw-r--r--src/modules/metacontacts/meta_menu.cpp16
-rw-r--r--src/modules/metacontacts/meta_services.cpp12
-rw-r--r--src/modules/metacontacts/meta_utils.cpp22
-rw-r--r--src/modules/netlib/netlibautoproxy.cpp4
-rw-r--r--src/modules/netlib/netlibhttpproxy.cpp4
-rw-r--r--src/modules/netlib/netlibopenconn.cpp4
-rw-r--r--src/modules/netlib/netlibupnp.cpp2
-rw-r--r--src/modules/options/options.cpp4
-rw-r--r--src/modules/protocols/protoaccs.cpp2
-rw-r--r--src/modules/protocols/protoopts.cpp2
-rw-r--r--src/modules/skin/hotkey_opts.cpp8
-rw-r--r--src/modules/skin/hotkeys.cpp10
-rw-r--r--src/modules/utils/enterstring.cpp4
216 files changed, 1178 insertions, 1154 deletions
diff --git a/include/m_core.h b/include/m_core.h
index c35fb86aa0..4515529b06 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -61,8 +61,6 @@ typedef uint32_t MCONTACT;
typedef uint32_t MEVENT;
-
-
///////////////////////////////////////////////////////////////////////////////
// events, hooks & services
@@ -733,6 +731,35 @@ MIR_CORE_DLL(void) UnloadCoreModule(void);
#if defined(__cplusplus)
}
+
+template <size_t _Size>
+inline int mir_snprintf(char(&buffer)[_Size], const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ return mir_vsnprintf(buffer, _Size, fmt, args);
+}
+
+template <size_t _Size>
+inline int mir_snwprintf(wchar_t(&buffer)[_Size], const wchar_t* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ return mir_vsnwprintf(buffer, _Size, fmt, args);
+}
+
+template <size_t _Size>
+inline int mir_vsnprintf(char(&buffer)[_Size], const char* fmt, va_list va)
+{
+ return mir_vsnprintf(buffer, _Size, fmt, va);
+}
+
+template <size_t _Size>
+inline int mir_vsnwprintf(wchar_t(&buffer)[_Size], const wchar_t* fmt, va_list va)
+{
+ return mir_vsnwprintf(buffer, _Size, fmt, va);
+}
+
#endif
#ifndef MIR_CORE_EXPORTS
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index 50d487328a..0eadf15e1d 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (data && data->action & AAF_SOUND) {
if (data->sound_num <= 3) {
char buff[128];
- mir_snprintf(buff, SIZEOF(buff), "Triggered%d", data->sound_num);
+ mir_snprintf(buff, "Triggered%d", data->sound_num);
SkinPlaySound(buff);
}
else if (data->sound_num == 4) {
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index 71e5171469..0c0d224de1 100644
--- a/plugins/Alarms/src/alarmlist.cpp
+++ b/plugins/Alarms/src/alarmlist.cpp
@@ -189,38 +189,38 @@ void LoadAlarms() {
for(int i = 0; i < num_alarms; i++) {
memset(&alarm, 0, sizeof(ALARM));
- mir_snprintf(buff, SIZEOF(buff), "Title%d", i);
+ mir_snprintf(buff, "Title%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szTitle = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
- mir_snprintf(buff, SIZEOF(buff), "Desc%d", i);
+ mir_snprintf(buff, "Desc%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szDesc = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
- mir_snprintf(buff, SIZEOF(buff), "Occ%d", i);
+ mir_snprintf(buff, "Occ%d", i);
alarm.occurrence = (Occurrence)db_get_w(0, MODULE, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "STHour%d", i);
+ mir_snprintf(buff, "STHour%d", i);
alarm.time.wHour = db_get_w(0, MODULE, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "STMinute%d", i);
+ mir_snprintf(buff, "STMinute%d", i);
alarm.time.wMinute = db_get_w(0, MODULE, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "STSecond%d", i);
+ mir_snprintf(buff, "STSecond%d", i);
alarm.time.wSecond = db_get_w(0, MODULE, buff, 0);
switch(alarm.occurrence) {
case OC_ONCE:
- mir_snprintf(buff, SIZEOF(buff), "STYear%d", i);
+ mir_snprintf(buff, "STYear%d", i);
alarm.time.wYear = db_get_w(0, MODULE, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "STMonth%d", i);
+ mir_snprintf(buff, "STMonth%d", i);
alarm.time.wMonth = db_get_w(0, MODULE, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "STDay%d", i);
+ mir_snprintf(buff, "STDay%d", i);
alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
break;
case OC_WEEKLY:
- mir_snprintf(buff, SIZEOF(buff), "STDayOfWeek%d", i);
+ mir_snprintf(buff, "STDayOfWeek%d", i);
alarm.time.wDayOfWeek = db_get_w(0, MODULE, buff, 0);
break;
case OC_WEEKDAYS:
@@ -228,26 +228,26 @@ void LoadAlarms() {
case OC_DAILY:
break;
case OC_MONTHLY:
- mir_snprintf(buff, SIZEOF(buff), "STDay%d", i);
+ mir_snprintf(buff, "STDay%d", i);
alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
break;
case OC_YEARLY:
- mir_snprintf(buff, SIZEOF(buff), "STMonth%d", i);
+ mir_snprintf(buff, "STMonth%d", i);
alarm.time.wMonth = db_get_w(0, MODULE, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "STDay%d", i);
+ mir_snprintf(buff, "STDay%d", i);
alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
break;
}
if (UpdateAlarm(alarm.time, alarm.occurrence)) {
- mir_snprintf(buff, SIZEOF(buff), "ActionFlags%d", i);
+ mir_snprintf(buff, "ActionFlags%d", i);
alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND);
if (alarm.action & AAF_COMMAND) {
- mir_snprintf(buff, SIZEOF(buff), "ActionCommand%d", i);
+ mir_snprintf(buff, "ActionCommand%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szCommand = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
- mir_snprintf(buff, SIZEOF(buff), "ActionParams%d", i);
+ mir_snprintf(buff, "ActionParams%d", i);
if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szCommandParams = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -255,22 +255,22 @@ void LoadAlarms() {
}
}
- mir_snprintf(buff, SIZEOF(buff), "SoundNum%d", i);
+ mir_snprintf(buff, "SoundNum%d", i);
alarm.sound_num = (int)db_get_b(0, MODULE, buff, 1);
- mir_snprintf(buff, SIZEOF(buff), "Snoozer%d", i);
+ mir_snprintf(buff, "Snoozer%d", i);
alarm.snoozer = db_get_b(0, MODULE, buff, 0) == 1;
- mir_snprintf(buff, SIZEOF(buff), "Hidden%d", i);
+ mir_snprintf(buff, "Hidden%d", i);
alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_HIDDEN : 0);
- mir_snprintf(buff, SIZEOF(buff), "Suspended%d", i);
+ mir_snprintf(buff, "Suspended%d", i);
alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_SUSPENDED : 0);
- mir_snprintf(buff, SIZEOF(buff), "NoStartup%d", i);
+ mir_snprintf(buff, "NoStartup%d", i);
alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_NOSTARTUP : 0);
- mir_snprintf(buff, SIZEOF(buff), "Flags%d", i);
+ mir_snprintf(buff, "Flags%d", i);
alarm.flags = db_get_dw(0, MODULE, buff, alarm.flags);
alarm.id = next_alarm_id++;
@@ -288,18 +288,18 @@ void SaveAlarms() {
ALARM *i;
for(alarms.reset(); i = alarms.current(); alarms.next(), index++) {
- mir_snprintf(buff, SIZEOF(buff), "Title%d", index);
+ mir_snprintf(buff, "Title%d", index);
db_set_ts(0, MODULE, buff, i->szTitle);
- mir_snprintf(buff, SIZEOF(buff), "Desc%d", index);
+ mir_snprintf(buff, "Desc%d", index);
db_set_ts(0, MODULE, buff, i->szDesc);
- mir_snprintf(buff, SIZEOF(buff), "Occ%d", index);
+ mir_snprintf(buff, "Occ%d", index);
db_set_w(0, MODULE, buff, i->occurrence);
- mir_snprintf(buff, SIZEOF(buff), "STHour%d", index);
+ mir_snprintf(buff, "STHour%d", index);
db_set_w(0, MODULE, buff, i->time.wHour);
- mir_snprintf(buff, SIZEOF(buff), "STMinute%d", index);
+ mir_snprintf(buff, "STMinute%d", index);
db_set_w(0, MODULE, buff, i->time.wMinute);
- mir_snprintf(buff, SIZEOF(buff), "STSecond%d", index);
+ mir_snprintf(buff, "STSecond%d", index);
db_set_w(0, MODULE, buff, i->time.wSecond);
switch(i->occurrence) {
@@ -308,41 +308,41 @@ void SaveAlarms() {
case OC_WEEKDAYS:
break;
case OC_WEEKLY:
- mir_snprintf(buff, SIZEOF(buff), "STDayOfWeek%d", index);
+ mir_snprintf(buff, "STDayOfWeek%d", index);
db_set_w(0, MODULE, buff, i->time.wDayOfWeek);
break;
case OC_ONCE:
- mir_snprintf(buff, SIZEOF(buff), "STYear%d", index);
+ mir_snprintf(buff, "STYear%d", index);
db_set_w(0, MODULE, buff, i->time.wYear);
case OC_YEARLY:
- mir_snprintf(buff, SIZEOF(buff), "STMonth%d", index);
+ mir_snprintf(buff, "STMonth%d", index);
db_set_w(0, MODULE, buff, i->time.wMonth);
case OC_MONTHLY:
- mir_snprintf(buff, SIZEOF(buff), "STDay%d", index);
+ mir_snprintf(buff, "STDay%d", index);
db_set_w(0, MODULE, buff, i->time.wDay);
break;
}
- mir_snprintf(buff, SIZEOF(buff), "ActionFlags%d", index);
+ mir_snprintf(buff, "ActionFlags%d", index);
db_set_dw(0, MODULE, buff, i->action);
if (i->action & AAF_COMMAND) {
if (mir_tstrlen(i->szCommand)) {
- mir_snprintf(buff, SIZEOF(buff), "ActionCommand%d", index);
+ mir_snprintf(buff, "ActionCommand%d", index);
db_set_ts(0, MODULE, buff, i->szCommand);
if (mir_tstrlen(i->szCommandParams)) {
- mir_snprintf(buff, SIZEOF(buff), "ActionParams%d", index);
+ mir_snprintf(buff, "ActionParams%d", index);
db_set_ts(0, MODULE, buff, i->szCommandParams);
}
}
}
- mir_snprintf(buff, SIZEOF(buff), "SoundNum%d", index);
+ mir_snprintf(buff, "SoundNum%d", index);
db_set_b(0, MODULE, buff, i->sound_num);
- mir_snprintf(buff, SIZEOF(buff), "Snoozer%d", index);
+ mir_snprintf(buff, "Snoozer%d", index);
db_set_b(0, MODULE, buff, i->snoozer ? 1 : 0);
- mir_snprintf(buff, SIZEOF(buff), "Flags%d", index);
+ mir_snprintf(buff, "Flags%d", index);
db_set_dw(0, MODULE, buff, i->flags);
}
db_set_w(0, MODULE, "Count", index);
@@ -521,7 +521,7 @@ void DoAlarm(ALARM *alarm)
if (alarm->action & AAF_SOUND) {
if (alarm->sound_num > 0 && alarm->sound_num <= 3) {
char buff[128];
- mir_snprintf(buff, SIZEOF(buff), "Triggered%d", alarm->sound_num);
+ mir_snprintf(buff, "Triggered%d", alarm->sound_num);
SkinPlaySound(buff);
} else if (alarm->sound_num == 4) {
if (alarm->szTitle != NULL && alarm->szTitle[0] != '\0') {
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp
index 08616eb610..e85385a2f5 100644
--- a/plugins/AssocMgr/src/assoclist.cpp
+++ b/plugins/AssocMgr/src/assoclist.cpp
@@ -50,7 +50,7 @@ static mir_cs csAssocList;
static BOOL IsAssocEnabled(const ASSOCDATA *assoc)
{
char szSetting[MAXMODULELABELLENGTH];
- mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
return db_get_b(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0;
}
@@ -58,13 +58,13 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
{
char szSetting[MAXMODULELABELLENGTH];
TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH];
- mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
/* dll name for uninstall */
if(assoc->hInstance!= NULL && assoc->hInstance!= hInst && assoc->hInstance!= GetModuleHandle(NULL))
if( GetModuleFileName(assoc->hInstance, szBuf, SIZEOF(szBuf)))
if( PathToRelativeT(szBuf, szDLL)) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, "module_%s", assoc->pszClassName);
db_set_ts(NULL, "AssocMgr", szSetting, szDLL);
}
}
@@ -72,10 +72,10 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
static void DeleteAssocEnabledSetting(const ASSOCDATA *assoc)
{
char szSetting[MAXMODULELABELLENGTH];
- mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
db_unset(NULL, "AssocMgr", szSetting);
/* dll name for uninstall */
- mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, "module_%s", assoc->pszClassName);
db_unset(NULL, "AssocMgr", szSetting);
}
@@ -94,7 +94,7 @@ void CleanupAssocEnabledSettings(void)
mir_cslock lck(csAssocList);
for(i = 0;i<nSettingsCount;++i) {
pszSuffix = &ppszSettings[i][8];
- mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", pszSuffix);
+ mir_snprintf(szSetting, "module_%s", pszSuffix);
if (!db_get_ts(NULL, "AssocMgr", szSetting, &dbv)) {
if( PathToAbsoluteT(dbv.ptszVal, szDLL)) {
/* file still exists? */
@@ -117,7 +117,7 @@ void CleanupAssocEnabledSettings(void)
static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char *pszFileExt, BYTE fAdded)
{
char szSetting[MAXMODULELABELLENGTH];
- mir_snprintf(szSetting, SIZEOF(szSetting), "mime_%s", pszMimeType);
+ mir_snprintf(szSetting, "mime_%s", pszMimeType);
if(fAdded) db_set_s(NULL, "AssocMgr", szSetting, pszFileExt);
else db_unset(NULL, "AssocMgr", szSetting);
}
@@ -127,7 +127,7 @@ static __inline BOOL WasMimeTypeAdded(const char *pszMimeType)
char szSetting[MAXMODULELABELLENGTH];
DBVARIANT dbv;
BOOL fAdded = FALSE;
- mir_snprintf(szSetting, SIZEOF(szSetting), "mime_%s", pszMimeType);
+ mir_snprintf(szSetting, "mime_%s", pszMimeType);
if (!db_get(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
else db_free(&dbv);
return fAdded;
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp
index 657b2d4197..21ae8a38dc 100644
--- a/plugins/AvatarHistory/src/utils.cpp
+++ b/plugins/AvatarHistory/src/utils.cpp
@@ -30,7 +30,7 @@ BOOL ProtocolEnabled(const char *proto)
return FALSE;
char setting[256];
- mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto);
+ mir_snprintf(setting, "%sEnabled", proto);
return (BOOL) db_get_b(NULL, MODULE_NAME, setting, TRUE);
}
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp
index f5994e4d2c..2ab17ec429 100644
--- a/plugins/BasicHistory/src/Options.cpp
+++ b/plugins/BasicHistory/src/Options.cpp
@@ -311,20 +311,20 @@ void Options::Load(void)
for (int i = 0; i < filtersCount; ++i) {
char buf[256];
FilterOptions fo;
- mir_snprintf(buf, SIZEOF(buf), "filterName_%d", i);
+ mir_snprintf(buf, "filterName_%d", i);
DBVARIANT nameV;
if (!db_get_ws(0, MODULE, buf, &nameV)) {
fo.name = nameV.pwszVal;
db_free(&nameV);
}
else break;
- mir_snprintf(buf, SIZEOF(buf), "filterInOut_%d", i);
+ mir_snprintf(buf, "filterInOut_%d", i);
int inOut = db_get_b(0, MODULE, buf, 0);
if (inOut == 1)
fo.onlyIncomming = true;
else if (inOut == 2)
fo.onlyOutgoing = true;
- mir_snprintf(buf, SIZEOF(buf), "filterEvents_%d", i);
+ mir_snprintf(buf, "filterEvents_%d", i);
DBVARIANT eventsV;
if (!db_get_s(0, MODULE, buf, &eventsV)) {
int k = 0;
@@ -467,9 +467,9 @@ void Options::Save()
db_set_dw(0, MODULE, "customFiltersCount", (DWORD)customFilters.size());
for (int i = 0 ; i < (int)customFilters.size(); ++i) {
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "filterName_%d", i);
+ mir_snprintf(buf, "filterName_%d", i);
db_set_ws(0, MODULE, buf, customFilters[i].name.c_str());
- mir_snprintf(buf, SIZEOF(buf), "filterInOut_%d", i);
+ mir_snprintf(buf, "filterInOut_%d", i);
db_set_b(0, MODULE, buf, customFilters[i].onlyIncomming ? 1 : (customFilters[i].onlyOutgoing ? 2 : 0));
std::string events;
for (std::vector<int>::iterator it = customFilters[i].events.begin(); it != customFilters[i].events.end(); ++it) {
@@ -478,7 +478,7 @@ void Options::Save()
events += ";";
}
- mir_snprintf(buf, SIZEOF(buf), "filterEvents_%d", i);
+ mir_snprintf(buf, "filterEvents_%d", i);
db_set_s(0, MODULE, buf, events.c_str());
}
@@ -507,54 +507,54 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks)
int i = 0;
char buf[256];
for (std::list<TaskOptions>::iterator it = tasks->begin(); it != tasks->end(); ++it) {
- mir_snprintf(buf, SIZEOF(buf), "Task_compress_%d", i);
+ mir_snprintf(buf, "Task_compress_%d", i);
db_set_b(0, MODULE, buf, it->compress);
- mir_snprintf(buf, SIZEOF(buf), "Task_useFtp_%d", i);
+ mir_snprintf(buf, "Task_useFtp_%d", i);
db_set_b(0, MODULE, buf, it->useFtp);
- mir_snprintf(buf, SIZEOF(buf), "Task_isSystem_%d", i);
+ mir_snprintf(buf, "Task_isSystem_%d", i);
db_set_b(0, MODULE, buf, it->isSystem);
- mir_snprintf(buf, SIZEOF(buf), "Task_active_%d", i);
+ mir_snprintf(buf, "Task_active_%d", i);
db_set_b(0, MODULE, buf, it->active);
- mir_snprintf(buf, SIZEOF(buf), "Task_exportImported_%d", i);
+ mir_snprintf(buf, "Task_exportImported_%d", i);
db_set_b(0, MODULE, buf, it->exportImported);
- mir_snprintf(buf, SIZEOF(buf), "Task_type_%d", i);
+ mir_snprintf(buf, "Task_type_%d", i);
db_set_b(0, MODULE, buf, it->type);
- mir_snprintf(buf, SIZEOF(buf), "Task_eventUnit_%d", i);
+ mir_snprintf(buf, "Task_eventUnit_%d", i);
db_set_b(0, MODULE, buf, it->eventUnit);
- mir_snprintf(buf, SIZEOF(buf), "Task_trigerType_%d", i);
+ mir_snprintf(buf, "Task_trigerType_%d", i);
db_set_b(0, MODULE, buf, it->trigerType);
- mir_snprintf(buf, SIZEOF(buf), "Task_exportType_%d", i);
+ mir_snprintf(buf, "Task_exportType_%d", i);
db_set_b(0, MODULE, buf, it->exportType);
- mir_snprintf(buf, SIZEOF(buf), "Task_importType_%d", i);
+ mir_snprintf(buf, "Task_importType_%d", i);
db_set_b(0, MODULE, buf, it->importType);
- mir_snprintf(buf, SIZEOF(buf), "Task_eventDeltaTime_%d", i);
+ mir_snprintf(buf, "Task_eventDeltaTime_%d", i);
db_set_dw(0, MODULE, buf, it->eventDeltaTime);
- mir_snprintf(buf, SIZEOF(buf), "Task_filterId_%d", i);
+ mir_snprintf(buf, "Task_filterId_%d", i);
db_set_dw(0, MODULE, buf, it->filterId);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayTime_%d", i);
+ mir_snprintf(buf, "Task_dayTime_%d", i);
db_set_dw(0, MODULE, buf, it->dayTime);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayOfWeek_%d", i);
+ mir_snprintf(buf, "Task_dayOfWeek_%d", i);
db_set_dw(0, MODULE, buf, it->dayOfWeek);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayOfMonth_%d", i);
+ mir_snprintf(buf, "Task_dayOfMonth_%d", i);
db_set_dw(0, MODULE, buf, it->dayOfMonth);
- mir_snprintf(buf, SIZEOF(buf), "Task_deltaTime_%d", i);
+ mir_snprintf(buf, "Task_deltaTime_%d", i);
db_set_dw(0, MODULE, buf, it->deltaTime);
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i);
+ mir_snprintf(buf, "Task_lastExport_low_%d", i);
db_set_dw(0, MODULE, buf, (int)it->lastExport);
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i);
+ mir_snprintf(buf, "Task_lastExport_hi_%d", i);
db_set_dw(0, MODULE, buf, ((unsigned long long int)it->lastExport) >> 32);
- mir_snprintf(buf, SIZEOF(buf), "Task_ftpName_%d", i);
+ mir_snprintf(buf, "Task_ftpName_%d", i);
db_set_ws(0, MODULE, buf, it->ftpName.c_str());
- mir_snprintf(buf, SIZEOF(buf), "Task_filterName_%d", i);
+ mir_snprintf(buf, "Task_filterName_%d", i);
db_set_ws(0, MODULE, buf, it->filterName.c_str());
- mir_snprintf(buf, SIZEOF(buf), "Task_filePath_%d", i);
+ mir_snprintf(buf, "Task_filePath_%d", i);
db_set_ws(0, MODULE, buf, it->filePath.c_str());
- mir_snprintf(buf, SIZEOF(buf), "Task_taskName_%d", i);
+ mir_snprintf(buf, "Task_taskName_%d", i);
db_set_ws(0, MODULE, buf, it->taskName.c_str());
- mir_snprintf(buf, SIZEOF(buf), "Task_zipPassword_%d", i);
+ mir_snprintf(buf, "Task_zipPassword_%d", i);
db_set_s(0, MODULE, buf, it->zipPassword.c_str());
- mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i);
+ mir_snprintf(buf, "IsInTask_%d", i);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_unset(hContact, MODULE, buf);
@@ -568,48 +568,48 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks)
db_set_dw(0, MODULE, "Task_count", i);
for (i = (int)tasks->size(); i < oldTaskNr; ++i) {
- mir_snprintf(buf, SIZEOF(buf), "Task_compress_%d", i);
+ mir_snprintf(buf, "Task_compress_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_useFtp_%d", i);
+ mir_snprintf(buf, "Task_useFtp_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_isSystem_%d", i);
+ mir_snprintf(buf, "Task_isSystem_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_active_%d", i);
+ mir_snprintf(buf, "Task_active_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_type_%d", i);
+ mir_snprintf(buf, "Task_type_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_eventUnit_%d", i);
+ mir_snprintf(buf, "Task_eventUnit_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_trigerType_%d", i);
+ mir_snprintf(buf, "Task_trigerType_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_exportType_%d", i);
+ mir_snprintf(buf, "Task_exportType_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_eventDeltaTime_%d", i);
+ mir_snprintf(buf, "Task_eventDeltaTime_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_filterId_%d", i);
+ mir_snprintf(buf, "Task_filterId_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayTime_%d", i);
+ mir_snprintf(buf, "Task_dayTime_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayOfWeek_%d", i);
+ mir_snprintf(buf, "Task_dayOfWeek_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayOfMonth_%d", i);
+ mir_snprintf(buf, "Task_dayOfMonth_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_deltaTime_%d", i);
+ mir_snprintf(buf, "Task_deltaTime_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i);
+ mir_snprintf(buf, "Task_lastExport_low_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i);
+ mir_snprintf(buf, "Task_lastExport_hi_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_ftpName_%d", i);
+ mir_snprintf(buf, "Task_ftpName_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_filterName_%d", i);
+ mir_snprintf(buf, "Task_filterName_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_filePath_%d", i);
+ mir_snprintf(buf, "Task_filePath_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "Task_taskName_%d", i);
+ mir_snprintf(buf, "Task_taskName_%d", i);
db_unset(NULL, MODULE, buf);
- mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i);
+ mir_snprintf(buf, "IsInTask_%d", i);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_unset(hContact, MODULE, buf);
}
@@ -619,9 +619,9 @@ void Options::SaveTaskTime(TaskOptions& to)
{
int i = to.orderNr;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i);
+ mir_snprintf(buf, "Task_lastExport_low_%d", i);
db_set_dw(0, MODULE, buf, (int)to.lastExport);
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i);
+ mir_snprintf(buf, "Task_lastExport_hi_%d", i);
db_set_dw(0, MODULE, buf, ((unsigned long long int)to.lastExport) >> 32);
}
@@ -631,71 +631,71 @@ void Options::LoadTasks()
char buf[256];
for (int i = 0; i < taskCount; ++i) {
TaskOptions to;
- mir_snprintf(buf, SIZEOF(buf), "Task_compress_%d", i);
+ mir_snprintf(buf, "Task_compress_%d", i);
to.compress = db_get_b(0, MODULE, buf, to.compress) != 0;
- mir_snprintf(buf, SIZEOF(buf), "Task_useFtp_%d", i);
+ mir_snprintf(buf, "Task_useFtp_%d", i);
to.useFtp = db_get_b(0, MODULE, buf, to.useFtp) != 0;
- mir_snprintf(buf, SIZEOF(buf), "Task_isSystem_%d", i);
+ mir_snprintf(buf, "Task_isSystem_%d", i);
to.isSystem = db_get_b(0, MODULE, buf, to.isSystem) != 0;
- mir_snprintf(buf, SIZEOF(buf), "Task_active_%d", i);
+ mir_snprintf(buf, "Task_active_%d", i);
to.active = db_get_b(0, MODULE, buf, to.active) != 0;
- mir_snprintf(buf, SIZEOF(buf), "Task_exportImported_%d", i);
+ mir_snprintf(buf, "Task_exportImported_%d", i);
to.exportImported = db_get_b(0, MODULE, buf, to.exportImported) != 0;
- mir_snprintf(buf, SIZEOF(buf), "Task_type_%d", i);
+ mir_snprintf(buf, "Task_type_%d", i);
to.type = (TaskOptions::TaskType)db_get_b(0, MODULE, buf, to.type);
- mir_snprintf(buf, SIZEOF(buf), "Task_eventUnit_%d", i);
+ mir_snprintf(buf, "Task_eventUnit_%d", i);
to.eventUnit = (TaskOptions::EventUnit)db_get_b(0, MODULE, buf, to.eventUnit);
- mir_snprintf(buf, SIZEOF(buf), "Task_trigerType_%d", i);
+ mir_snprintf(buf, "Task_trigerType_%d", i);
to.trigerType = (TaskOptions::TrigerType)db_get_b(0, MODULE, buf, to.trigerType);
- mir_snprintf(buf, SIZEOF(buf), "Task_exportType_%d", i);
+ mir_snprintf(buf, "Task_exportType_%d", i);
to.exportType = (IExport::ExportType)db_get_b(0, MODULE, buf, to.exportType);
- mir_snprintf(buf, SIZEOF(buf), "Task_importType_%d", i);
+ mir_snprintf(buf, "Task_importType_%d", i);
to.importType = (IImport::ImportType)db_get_b(0, MODULE, buf, to.importType);
- mir_snprintf(buf, SIZEOF(buf), "Task_eventDeltaTime_%d", i);
+ mir_snprintf(buf, "Task_eventDeltaTime_%d", i);
to.eventDeltaTime = db_get_dw(0, MODULE, buf, to.eventDeltaTime);
- mir_snprintf(buf, SIZEOF(buf), "Task_filterId_%d", i);
+ mir_snprintf(buf, "Task_filterId_%d", i);
to.filterId = db_get_dw(0, MODULE, buf, to.filterId);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayTime_%d", i);
+ mir_snprintf(buf, "Task_dayTime_%d", i);
to.dayTime = db_get_dw(0, MODULE, buf, to.dayTime);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayOfWeek_%d", i);
+ mir_snprintf(buf, "Task_dayOfWeek_%d", i);
to.dayOfWeek = db_get_dw(0, MODULE, buf, to.dayOfWeek);
- mir_snprintf(buf, SIZEOF(buf), "Task_dayOfMonth_%d", i);
+ mir_snprintf(buf, "Task_dayOfMonth_%d", i);
to.dayOfMonth = db_get_dw(0, MODULE, buf, to.dayOfMonth);
- mir_snprintf(buf, SIZEOF(buf), "Task_deltaTime_%d", i);
+ mir_snprintf(buf, "Task_deltaTime_%d", i);
to.deltaTime = db_get_dw(0, MODULE, buf, to.deltaTime);
unsigned long long int le = to.lastExport;
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i);
+ mir_snprintf(buf, "Task_lastExport_low_%d", i);
to.lastExport = db_get_dw(0, MODULE, buf, (int)le) & 0xffffffff;
- mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i);
+ mir_snprintf(buf, "Task_lastExport_hi_%d", i);
to.lastExport |= ((unsigned long long int)db_get_dw(0, MODULE, buf, le >> 32)) << 32;
- mir_snprintf(buf, SIZEOF(buf), "Task_ftpName_%d", i);
+ mir_snprintf(buf, "Task_ftpName_%d", i);
DBVARIANT var;
if (!db_get_ws(0, MODULE, buf, &var)) {
to.ftpName = var.ptszVal;
db_free(&var);
}
- mir_snprintf(buf, SIZEOF(buf), "Task_filterName_%d", i);
+ mir_snprintf(buf, "Task_filterName_%d", i);
if (!db_get_ws(0, MODULE, buf, &var)) {
to.filterName = var.ptszVal;
db_free(&var);
}
- mir_snprintf(buf, SIZEOF(buf), "Task_filePath_%d", i);
+ mir_snprintf(buf, "Task_filePath_%d", i);
if (!db_get_ws(0, MODULE, buf, &var)) {
to.filePath = var.ptszVal;
db_free(&var);
}
- mir_snprintf(buf, SIZEOF(buf), "Task_taskName_%d", i);
+ mir_snprintf(buf, "Task_taskName_%d", i);
if (!db_get_ws(0, MODULE, buf, &var)) {
to.taskName = var.ptszVal;
db_free(&var);
}
- mir_snprintf(buf, SIZEOF(buf), "Task_zipPassword_%d", i);
+ mir_snprintf(buf, "Task_zipPassword_%d", i);
if (!db_get_s(0, MODULE, buf, &var)) {
to.zipPassword = var.pszVal;
db_free(&var);
}
- mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i);
+ mir_snprintf(buf, "IsInTask_%d", i);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if (db_get_b(hContact, MODULE, buf, 0) == 1)
to.contacts.push_back(hContact);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index 9cd70916c5..b9bf0c759e 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -234,7 +234,7 @@ void addProtoStatusMenuItem(char *protoName)
return;
char buf[200];
- mir_snprintf(buf, SIZEOF(buf), "CSList/ShowList/%s", protoName);
+ mir_snprintf(buf, "CSList/ShowList/%s", protoName);
if (!ServiceExists(buf))
CreateServiceFunctionParam(buf, showList, (LPARAM)protoName);
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp
index 99a496b4cf..42d4e19b2e 100644
--- a/plugins/Clist_blind/src/cluiopts.cpp
+++ b/plugins/Clist_blind/src/cluiopts.cpp
@@ -138,9 +138,9 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_HSCROLL:
{
char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
}
if (wParam != 0x12345678)
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index 1d287f65d0..f7406fd5fb 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -85,7 +85,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
tmi.ownerdata = mmep;
char buf[1024];
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
+ mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
@@ -398,7 +398,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
tmi.ownerdata = mmep;
char buf[1024];
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
+ mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 22cd91558f..eb3442289b 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -712,7 +712,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc
}
// check the proto, use it as a base filter result for all further checks
if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", szProto);
+ mir_snprintf(szTemp, "%s|", szProto);
filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 9d762dd183..ea2cdbfbdb 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -146,7 +146,7 @@ void RegisterCLUIFonts(void)
mir_tstrncpy(fontid.group, fontOptionsList[i].szGroup, SIZEOF(fontid.group));
mir_tstrncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
- mir_snprintf(idstr, SIZEOF(idstr), "Font%d", fontOptionsList[i].fontID);
+ mir_snprintf(idstr, "Font%d", fontOptionsList[i].fontID);
mir_strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
fontid.order = i + 1;
@@ -160,7 +160,7 @@ void RegisterCLUIFonts(void)
mir_tstrncpy(effectid.group, fontOptionsList[i].szGroup, SIZEOF(effectid.group));
mir_tstrncpy(effectid.name, fontOptionsList[i].szDescr, SIZEOF(effectid.name));
- mir_snprintf(idstr, SIZEOF(idstr), "Font%d", fontOptionsList[i].fontID);
+ mir_snprintf(idstr, "Font%d", fontOptionsList[i].fontID);
mir_strncpy(effectid.setting, idstr, SIZEOF(effectid.setting));
effectid.order = i + 1;
@@ -220,11 +220,11 @@ void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF
*colour = col;
if (effect) {
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dEffect", i);
+ mir_snprintf(idstr, "Font%dEffect", i);
*effect = db_get_b(NULL, "CLC", idstr, 0);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dEffectCol1", i);
+ mir_snprintf(idstr, "Font%dEffectCol1", i);
*eColour1 = db_get_dw(NULL, "CLC", idstr, 0);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dEffectCol2", i);
+ mir_snprintf(idstr, "Font%dEffectCol2", i);
*eColour2 = db_get_dw(NULL, "CLC", idstr, 0);
}
}
@@ -1111,9 +1111,9 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
case WM_HSCROLL:
{
char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
}
if (wParam != 0x12345678)
@@ -1695,9 +1695,9 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar
break;
case WM_HSCROLL:
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
if (wParam != 0x12345678 && !bInit)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index f68832d1b9..c98a8645b5 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -524,7 +524,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
int defItemsOrder[NUM_ITEM_TYPE] = SETTINS_ROWITEMORDER_DEFAULT;
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
char tmp[128];
- mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i);
+ mir_snprintf(tmp, "RowPos%d", i);
dat->row_items[i] = db_get_w(NULL, "CList", tmp, defItemsOrder[i]);
}
}
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp
index 0f317ee373..20e6f19089 100644
--- a/plugins/Clist_modern/src/modern_clistopts.cpp
+++ b/plugins/Clist_modern/src/modern_clistopts.cpp
@@ -62,7 +62,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
int type;
int pos = 0;
- mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i);
+ mir_snprintf(tmp, "RowPos%d", i);
type = db_get_w(NULL, "CList", tmp, i);
switch (type) {
@@ -207,7 +207,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST_ORDER);
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
char tmp[128];
- mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i);
+ mir_snprintf(tmp, "RowPos%d", i);
db_set_w(NULL, "CList", tmp, (WORD)SendMessage(hwndList, LB_GETITEMDATA, i, 0));
}
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 8474bb8961..c3a8f275a7 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -2477,7 +2477,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam)
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 1, dis->itemState);
- mir_snprintf(buf, SIZEOF(buf), "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False");
+ mir_snprintf(buf, "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False");
SkinDrawGlyph(dis->hDC, &dis->rcItem, &dis->rcItem, buf);
int x = (dis->rcItem.right + dis->rcItem.left - GetSystemMetrics(SM_CXSMICON)) / 2 + offset;
@@ -2511,7 +2511,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam)
}
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 2, dis->itemState);
SetBkMode(dis->hDC, TRANSPARENT);
- mir_snprintf(buf, SIZEOF(buf), "Main,ID=StatusMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False");
+ mir_snprintf(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"), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
@@ -2530,7 +2530,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam)
short dx = 1 + (dis->itemState&ODS_SELECTED ? 1 : 0) - (dis->itemState&ODS_HOTLIGHT ? 1 : 0);
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 3, dis->itemState);
- mir_snprintf(buf, SIZEOF(buf), "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False");
+ mir_snprintf(buf, "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False");
SkinDrawGlyph(dis->hDC, &dis->rcItem, &dis->rcItem, buf);
DrawState(dis->hDC, NULL, NULL, (LPARAM)hIcon, 0, (dis->rcItem.right + dis->rcItem.left - GetSystemMetrics(SM_CXSMICON)) / 2 + dx, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2 + dx, 0, 0, DST_ICON);
Skin_ReleaseIcon(hIcon);
diff --git a/plugins/Clist_modern/src/modern_log.cpp b/plugins/Clist_modern/src/modern_log.cpp
index 25122fef72..f14ec4ca36 100644
--- a/plugins/Clist_modern/src/modern_log.cpp
+++ b/plugins/Clist_modern/src/modern_log.cpp
@@ -31,7 +31,7 @@ void Log(const char *file, int line, const char *fmt, ...)
tmp++;
}
}
- mir_snprintf(buf, SIZEOF(buf), "clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n", GetCurrentThreadId(), GetTickCount(), str, file_tmp, line);
+ mir_snprintf(buf, "clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n", GetCurrentThreadId(), GetTickCount(), str, file_tmp, line);
#ifdef _FILELOG_
{
FILE *fp;
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp
index 8da157d3c4..d435f7e0e2 100644
--- a/plugins/Clist_modern/src/modern_newrowopts.cpp
+++ b/plugins/Clist_modern/src/modern_newrowopts.cpp
@@ -120,7 +120,7 @@ void TraceTreeLevel(NodeList * node)
PrintIdent();
{
char buf[255];
- mir_snprintf(buf, SIZEOF(buf), "%d\n", node->pData);
+ mir_snprintf(buf, "%d\n", node->pData);
TRACE(buf);
}
ident += 5;
@@ -134,7 +134,7 @@ void TraceTreeLevel(NodeList * node)
PrintIdent();
{
char buf[255];
- mir_snprintf(buf, SIZEOF(buf), "%d\n", node->childNodes[i].pData);
+ mir_snprintf(buf, "%d\n", node->childNodes[i].pData);
TRACE(buf);
}
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index 892b9a983f..24bccdd60c 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -38,28 +38,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//Implementation
-#pragma pack(push, 1)
-/* tga header */
-struct tga_header_t
-{
- BYTE id_lenght; /* size of image id */
- BYTE colormap_type; /* 1 is has a colormap */
- BYTE image_type; /* compression type */
-
- short cm_first_entry; /* colormap origin */
- short cm_length; /* colormap length */
- BYTE cm_size; /* colormap size */
-
- short x_origin; /* bottom left x coord origin */
- short y_origin; /* bottom left y coord origin */
-
- short width; /* picture width (in pixels) */
- short height; /* picture height (in pixels) */
-
- BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */
- BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */
-};
-#pragma pack(pop)
+#pragma pack(push, 1)
+/* tga header */
+struct tga_header_t
+{
+ BYTE id_lenght; /* size of image id */
+ BYTE colormap_type; /* 1 is has a colormap */
+ BYTE image_type; /* compression type */
+
+ short cm_first_entry; /* colormap origin */
+ short cm_length; /* colormap length */
+ BYTE cm_size; /* colormap size */
+
+ short x_origin; /* bottom left x coord origin */
+ short y_origin; /* bottom left y coord origin */
+
+ short width; /* picture width (in pixels) */
+ short height; /* picture height (in pixels) */
+
+ BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */
+ BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */
+};
+#pragma pack(pop)
/* Global variables */
@@ -3300,7 +3300,7 @@ static DWORD ske_HexToARGB(char * Hex)
{
char buf[10] = { 0 };
char buf2[11] = { 0 };
- mir_snprintf(buf, SIZEOF(buf), "%s\n", Hex);
+ mir_snprintf(buf, "%s\n", Hex);
if (buf[1] == 'x' || buf[1] == 'X')
mir_snprintf(buf2, SIZEOF(buf2), "0x%s\n", buf + 2);
else
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index fcd2fc2bf0..7f5e2e6e3d 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -187,18 +187,18 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
continue;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", szProto);
+ mir_snprintf(buf, "SBarAccountIsCustom_%s", szProto);
ProtoItemData *p = NULL;
if (g_StatusBarData.perProtoConfig && db_get_b(NULL, "CLUI", buf, SETTING_SBARACCOUNTISCUSTOM_DEFAULT)) {
- mir_snprintf(buf, SIZEOF(buf), "HideAccount_%s", szProto);
+ mir_snprintf(buf, "HideAccount_%s", szProto);
if (db_get_b(NULL, "CLUI", buf, SETTING_SBARHIDEACCOUNT_DEFAULT)) {
iProtoInStatusMenu++;
continue;
}
- mir_snprintf(buf, SIZEOF(buf), "SBarShow_%s", szProto);
+ mir_snprintf(buf, "SBarShow_%s", szProto);
BYTE showOps = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
p = new ProtoItemData;
@@ -206,22 +206,22 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
p->bShowProtoName = (showOps & 2) != 0;
p->bShowStatusName = (showOps & 4) != 0;
- mir_snprintf(buf, SIZEOF(buf), "ShowXStatus_%s", szProto);
+ mir_snprintf(buf, "ShowXStatus_%s", szProto);
p->xStatusMode = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "UseConnectingIcon_%s", szProto);
+ mir_snprintf(buf, "UseConnectingIcon_%s", szProto);
p->bConnectingIcon = db_get_b(NULL, "CLUI", buf, SETTING_USECONNECTINGICON_DEFAULT) != 0;
- mir_snprintf(buf, SIZEOF(buf), "ShowUnreadEmails_%s", szProto);
+ mir_snprintf(buf, "ShowUnreadEmails_%s", szProto);
p->bShowProtoEmails = db_get_b(NULL, "CLUI", buf, SETTING_SHOWUNREADEMAILS_DEFAULT) != 0;
- mir_snprintf(buf, SIZEOF(buf), "SBarRightClk_%s", szProto);
+ mir_snprintf(buf, "SBarRightClk_%s", szProto);
p->SBarRightClk = db_get_b(NULL, "CLUI", buf, SETTING_SBARRIGHTCLK_DEFAULT) != 0;
- mir_snprintf(buf, SIZEOF(buf), "PaddingLeft_%s", szProto);
+ mir_snprintf(buf, "PaddingLeft_%s", szProto);
p->PaddingLeft = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGLEFT_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "PaddingRight_%s", szProto);
+ mir_snprintf(buf, "PaddingRight_%s", szProto);
p->PaddingRight = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGRIGHT_DEFAULT);
}
else {
@@ -258,7 +258,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
p->bIsDimmed = 0;
if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
char szTemp[2048];
- mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", p->szAccountName);
+ mir_snprintf(szTemp, "%s|", p->szAccountName);
p->bIsDimmed = strstr(g_CluiData.protoFilter, szTemp) ? 0 : 1;
}
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index 569bfbe3b3..acf1c22e7e 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -180,31 +180,31 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
SendMessage(hwndComboBox, CB_SETITEMDATA, dwNewId, (LPARAM)dat);
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", szName);
+ mir_snprintf(buf, "SBarAccountIsCustom_%s", szName);
dat->AccountIsCustomized = db_get_b(NULL, "CLUI", buf, SETTING_SBARACCOUNTISCUSTOM_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "HideAccount_%s", szName);
+ mir_snprintf(buf, "HideAccount_%s", szName);
dat->HideAccount = db_get_b(NULL, "CLUI", buf, SETTING_SBARHIDEACCOUNT_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "SBarShow_%s", szName);
+ mir_snprintf(buf, "SBarShow_%s", szName);
dat->SBarShow = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "SBarRightClk_%s", szName);
+ mir_snprintf(buf, "SBarRightClk_%s", szName);
dat->SBarRightClk = db_get_b(NULL, "CLUI", buf, SETTING_SBARRIGHTCLK_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "ShowUnreadEmails_%s", szName);
+ mir_snprintf(buf, "ShowUnreadEmails_%s", szName);
dat->ShowUnreadEmails = db_get_b(NULL, "CLUI", buf, SETTING_SHOWUNREADEMAILS_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "ShowXStatus_%s", szName);
+ mir_snprintf(buf, "ShowXStatus_%s", szName);
dat->ShowXStatus = db_get_b(NULL, "CLUI", buf, SETTING_SHOWXSTATUS_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "UseConnectingIcon_%s", szName);
+ mir_snprintf(buf, "UseConnectingIcon_%s", szName);
dat->UseConnectingIcon = db_get_b(NULL, "CLUI", buf, SETTING_USECONNECTINGICON_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "PaddingLeft_%s", szName);
+ mir_snprintf(buf, "PaddingLeft_%s", szName);
dat->PaddingLeft = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGLEFT_DEFAULT);
- mir_snprintf(buf, SIZEOF(buf), "PaddingRight_%s", szName);
+ mir_snprintf(buf, "PaddingRight_%s", szName);
dat->PaddingRight = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGRIGHT_DEFAULT);
}
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 3771fc2324..e3b12a3db7 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -70,13 +70,13 @@ void Modern_InitButtons()
char buf[255];
if (i != 0) {
- mir_snprintf(buf, SIZEOF(buf), "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn");
+ mir_snprintf(buf, "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn");
tbb.hIconHandleUp = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipUp, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx, g_hInst, BTNS[i].defResource);
}
else tbb.hIconHandleUp = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipUp, NULL, 0, NULL, SKINICON_OTHER_MAINMENU);
if (BTNS[i].pszTooltipDn) {
- mir_snprintf(buf, SIZEOF(buf), "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up");
+ mir_snprintf(buf, "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up");
tbb.hIconHandleDn = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipDn, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx + 1, g_hInst, BTNS[i].defResource2);
}
else tbb.hIconHandleDn = NULL;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 62280566a4..e8d28ed80a 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -349,17 +349,17 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr
CLVM_EnumModes(DeleteAutoModesCallback);
char szSetting[512];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name);
+ mir_snprintf(szSetting, "%c%s_PF", 246, name);
db_set_s(NULL, CLVM_MODULE, szSetting, szProtoFilter);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name);
+ mir_snprintf(szSetting, "%c%s_GF", 246, name);
db_set_ws(NULL, CLVM_MODULE, szSetting, szGroupFilter);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, name);
+ mir_snprintf(szSetting, "%c%s_SM", 246, name);
db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, name);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, name);
db_set_dw(NULL, CLVM_MODULE, szSetting, stickyStatusMask);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, name);
db_set_dw(NULL, CLVM_MODULE, szSetting, options);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, name);
+ mir_snprintf(szSetting, "%c%s_LM", 246, name);
db_set_dw(NULL, CLVM_MODULE, szSetting, lmdat);
db_set_dw(NULL, CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies));
@@ -504,23 +504,23 @@ static void UpdateFilters()
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
ptrA szPF(db_get_sa(NULL, CLVM_MODULE, szSetting));
if (szPF == NULL)
return;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
ptrT szGF(db_get_tsa(NULL, CLVM_MODULE, szSetting));
if (szGF == NULL)
return;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf);
if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) != -1)
SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SM", 246, szBuf);
DWORD statusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf);
stickyStatusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
dwFlags = db_get_dw(NULL, CLVM_MODULE, szBuf, 0);
{
@@ -593,7 +593,7 @@ static void UpdateFilters()
EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMSGVALUE), useLastMsg);
EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMESSAGEUNIT), useLastMsg);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_LM", 246, szBuf);
DWORD lmdat = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
SetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
@@ -610,15 +610,15 @@ void DeleteViewMode(char * szName)
{
char szSetting[256];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szName);
+ mir_snprintf(szSetting, "%c%s_PF", 246, szName);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szName);
+ mir_snprintf(szSetting, "%c%s_GF", 246, szName);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szName);
+ mir_snprintf(szSetting, "%c%s_SM", 246, szName);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_VA", 246, szName);
+ mir_snprintf(szSetting, "%c%s_VA", 246, szName);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szName);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, szName);
db_unset(NULL, CLVM_MODULE, szSetting);
db_unset(NULL, CLVM_MODULE, szName);
@@ -1223,7 +1223,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
g_CluiData.bFilterEffective = 0;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246);
+ mir_snprintf(szSetting, "%c_LastMode", 246);
if (!Name) { // Name is null - apply last stored view mode
if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
@@ -1238,7 +1238,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
g_CluiData.bFilterEffective = 0;
// remove last applied view mode
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246);
+ mir_snprintf(szSetting, "%c_LastMode", 246);
db_unset(NULL, CLVM_MODULE, szSetting);
if (g_CluiData.bOldUseGroups != (BYTE)-1)
@@ -1259,7 +1259,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
}
if (!onlySelector) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, Name);
+ mir_snprintf(szSetting, "%c%s_PF", 246, Name);
if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_strlen(dbv.pszVal) >= 2) {
mir_strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
@@ -1268,7 +1268,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
}
mir_free(dbv.pszVal);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, Name);
+ mir_snprintf(szSetting, "%c%s_GF", 246, Name);
if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_tstrlen(dbv.ptszVal) >= 2) {
mir_tstrncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter));
@@ -1277,12 +1277,12 @@ void ApplyViewMode(const char *Name, bool onlySelector)
}
mir_free(dbv.ptszVal);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, Name);
+ mir_snprintf(szSetting, "%c%s_SM", 246, Name);
g_CluiData.statusMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
if (g_CluiData.statusMaskFilter >= 1)
g_CluiData.bFilterEffective |= CLVM_FILTER_STATUS;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, Name);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, Name);
g_CluiData.stickyMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
if (g_CluiData.stickyMaskFilter != -1)
g_CluiData.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
@@ -1292,14 +1292,14 @@ void ApplyViewMode(const char *Name, bool onlySelector)
KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
if (g_CluiData.filterFlags & CLVM_AUTOCLEAR) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, Name);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, Name);
DWORD timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0));
mir_strncpy(g_CluiData.old_viewmode, g_CluiData.current_viewmode, SIZEOF(g_CluiData.old_viewmode));
g_CluiData.old_viewmode[255] = 0;
CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
}
else { //store last selected view mode only if it is not autoclear
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246);
+ mir_snprintf(szSetting, "%c_LastMode", 246);
db_set_s(NULL, CLVM_MODULE, szSetting, Name);
}
mir_strncpy(g_CluiData.current_viewmode, Name, SIZEOF(g_CluiData.current_viewmode));
@@ -1316,7 +1316,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
g_CluiData.bSortByOrder[0] = bSaved;
g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, Name);
+ mir_snprintf(szSetting, "%c%s_LM", 246, Name);
g_CluiData.lastMsgFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
if (LOBYTE(HIWORD(g_CluiData.lastMsgFilter)))
g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
index 5634ab1cc1..e2ef621a41 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
@@ -93,7 +93,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
tmi.ownerdata = mmep;
char buf[1024];
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
+ mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
@@ -428,7 +428,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
tmi.ownerdata = mmep;
char buf[1024];
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
+ mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName);
OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index 2d1cf246f3..c171a09813 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -480,7 +480,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str
}
// check the proto, use it as a base filter result for all further checks
if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", szProto);
+ mir_snprintf(szTemp, "%s|", szProto);
filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
}
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 3d3f28348a..096fe9ff54 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -1618,7 +1618,7 @@ buttons_done:
GetWindowRect(pcli->hwndContactTree, &rc);
// x/y might be -1 if it was generated by a kb click
- POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if (pt.x == -1 && pt.y == -1) {
// all this is done in screen-coords!
GetCursorPos(&pt);
@@ -1851,7 +1851,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
{
char str[64];
DWORD v = pluginInfo.version;
- mir_snprintf(str, SIZEOF(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
+ mir_snprintf(str, "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
SetDlgItemTextA(hwndDlg, IDC_VERSION, str);
}
{
@@ -2033,7 +2033,7 @@ void FS_RegisterFonts()
_tcsncpy(fid.name, clistFontDescr[i].tszName, SIZEOF(fid.name));
char idstr[10];
- mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i);
+ mir_snprintf(idstr, "Font%d", i);
strncpy(fid.prefix, idstr, SIZEOF(fid.prefix));
fid.order = i;
FontRegisterT(&fid);
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp
index baa147581a..7fac4e76ba 100644
--- a/plugins/Clist_nicer/src/cluiopts.cpp
+++ b/plugins/Clist_nicer/src/cluiopts.cpp
@@ -152,9 +152,9 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_HSCROLL:
{
char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
}
if (wParam != 0x12345678) {
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index f569932195..2c9b7f4e74 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -302,7 +302,7 @@ void LoadExtBkSettingsFromDB()
continue;
p->imageItem = 0;
- char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname);
+ char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, "%s_", p->szDBname);
mir_strcpy(pszEnd, "IGNORE"); p->IGNORED = (BYTE)cfg::getByte("CLCExt", buffer, p->IGNORED);
mir_strcpy(pszEnd, "GRADIENT"); p->GRADIENT = (BYTE)cfg::getDword("CLCExt", buffer, p->GRADIENT);
mir_strcpy(pszEnd, "CORNER"); p->CORNER = (BYTE)cfg::getDword("CLCExt", buffer, p->CORNER);
@@ -338,31 +338,31 @@ static void SaveCompleteStructToDB()
StatusItems_t *p = arStatusItems[n];
if (p->statusID != ID_EXTBKSEPARATOR) {
char buffer[255];
- mir_snprintf(buffer, SIZEOF(buffer), "%s_IGNORE", p->szDBname);
+ mir_snprintf(buffer, "%s_IGNORE", p->szDBname);
cfg::writeByte("CLCExt", buffer, p->IGNORED);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_GRADIENT", p->szDBname);
+ mir_snprintf(buffer, "%s_GRADIENT", p->szDBname);
cfg::writeDword("CLCExt", buffer, p->GRADIENT);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_CORNER", p->szDBname);
+ mir_snprintf(buffer, "%s_CORNER", p->szDBname);
cfg::writeDword("CLCExt", buffer, p->CORNER);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR", p->szDBname);
+ mir_snprintf(buffer, "%s_COLOR", p->szDBname);
cfg::writeDword("CLCExt", buffer, p->COLOR);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2", p->szDBname);
+ mir_snprintf(buffer, "%s_COLOR2", p->szDBname);
cfg::writeDword("CLCExt", buffer, p->COLOR2);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2_TRANSPARENT", p->szDBname);
+ mir_snprintf(buffer, "%s_COLOR2_TRANSPARENT", p->szDBname);
cfg::writeByte("CLCExt", buffer, p->COLOR2_TRANSPARENT);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_TEXTCOLOR", p->szDBname);
+ mir_snprintf(buffer, "%s_TEXTCOLOR", p->szDBname);
cfg::writeDword("CLCExt", buffer, p->TEXTCOLOR);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_ALPHA", p->szDBname);
+ mir_snprintf(buffer, "%s_ALPHA", p->szDBname);
cfg::writeByte("CLCExt", buffer, (BYTE)p->ALPHA);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_LEFT", p->szDBname);
+ mir_snprintf(buffer, "%s_MRGN_LEFT", p->szDBname);
cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_LEFT);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_TOP", p->szDBname);
+ mir_snprintf(buffer, "%s_MRGN_TOP", p->szDBname);
cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_TOP);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_RIGHT", p->szDBname);
+ mir_snprintf(buffer, "%s_MRGN_RIGHT", p->szDBname);
cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_RIGHT);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_BOTTOM", p->szDBname);
+ mir_snprintf(buffer, "%s_MRGN_BOTTOM", p->szDBname);
cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_BOTTOM);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_BDRSTYLE", p->szDBname);
+ mir_snprintf(buffer, "%s_BDRSTYLE", p->szDBname);
cfg::writeDword("CLCExt", buffer, p->BORDERSTYLE);
}
}
@@ -470,7 +470,7 @@ void extbk_export(char *file)
if (p->statusID == ID_EXTBKSEPARATOR)
continue;
- char *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname);
+ char *pszEnd = buffer + mir_snprintf(buffer, "%s_", p->szDBname);
mir_strcpy(pszEnd, "ALPHA"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file);
mir_strcpy(pszEnd, "COLOR"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file);
mir_strcpy(pszEnd, "COLOR2"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file);
@@ -1331,31 +1331,31 @@ void extbk_import(char *file, HWND hwndDlg)
if (p->statusID == ID_EXTBKSEPARATOR)
continue;
- mir_snprintf(buffer, SIZEOF(buffer), "%s_ALPHA", p->szDBname);
+ mir_snprintf(buffer, "%s_ALPHA", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR", p->szDBname);
+ mir_snprintf(buffer, "%s_COLOR", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2", p->szDBname);
+ mir_snprintf(buffer, "%s_COLOR2", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2_TRANSPARENT", p->szDBname);
+ mir_snprintf(buffer, "%s_COLOR2_TRANSPARENT", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2_TRANSPARENT), sizeof(p->COLOR2_TRANSPARENT), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_TEXTCOLOR", p->szDBname);
+ mir_snprintf(buffer, "%s_TEXTCOLOR", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->TEXTCOLOR), sizeof(p->TEXTCOLOR), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_CORNER", p->szDBname);
+ mir_snprintf(buffer, "%s_CORNER", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->CORNER), sizeof(p->CORNER), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_GRADIENT", p->szDBname);
+ mir_snprintf(buffer, "%s_GRADIENT", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->GRADIENT), sizeof(p->GRADIENT), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_IGNORED", p->szDBname);
+ mir_snprintf(buffer, "%s_IGNORED", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->IGNORED), sizeof(p->IGNORED), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_BOTTOM", p->szDBname);
+ mir_snprintf(buffer, "%s_MARGIN_BOTTOM", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_BOTTOM), sizeof(p->MARGIN_BOTTOM), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_LEFT", p->szDBname);
+ mir_snprintf(buffer, "%s_MARGIN_LEFT", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_LEFT), sizeof(p->MARGIN_LEFT), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_RIGHT", p->szDBname);
+ mir_snprintf(buffer, "%s_MARGIN_RIGHT", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_RIGHT), sizeof(p->MARGIN_RIGHT), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_TOP", p->szDBname);
+ mir_snprintf(buffer, "%s_MARGIN_TOP", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_TOP), sizeof(p->MARGIN_TOP), file);
- mir_snprintf(buffer, SIZEOF(buffer), "%s_BORDERSTYLE", p->szDBname);
+ mir_snprintf(buffer, "%s_BORDERSTYLE", p->szDBname);
GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->BORDERSTYLE), sizeof(p->BORDERSTYLE), file);
}
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index b2d6d8e753..7903d52204 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -302,17 +302,17 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr
{
char szSetting[512];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name);
+ mir_snprintf(szSetting, "%c%s_PF", 246, name);
cfg::writeString(NULL, CLVM_MODULE, szSetting, szProtoFilter);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name);
+ mir_snprintf(szSetting, "%c%s_GF", 246, name);
cfg::writeTString(NULL, CLVM_MODULE, szSetting, szGroupFilter);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, name);
+ mir_snprintf(szSetting, "%c%s_SM", 246, name);
cfg::writeDword(CLVM_MODULE, szSetting, statusMask);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, name);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, name);
cfg::writeDword(CLVM_MODULE, szSetting, stickyStatusMask);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, name);
cfg::writeDword(CLVM_MODULE, szSetting, options);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, name);
+ mir_snprintf(szSetting, "%c%s_LM", 246, name);
cfg::writeDword(CLVM_MODULE, szSetting, lmdat);
cfg::writeDword(CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies));
@@ -449,21 +449,21 @@ void UpdateFilters()
SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szBuf);
strncpy(g_szModename, szBuf, sizeof(g_szModename));
g_szModename[sizeof(g_szModename) - 1] = 0;
- mir_snprintf(szTemp, SIZEOF(szTemp), Translate("Current view mode: %s"), g_szModename);
+ mir_snprintf(szTemp, Translate("Current view mode: %s"), g_szModename);
SetDlgItemTextA(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
if (db_get(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
if (cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf);
if ((opt = cfg::getDword(NULL, CLVM_MODULE, szSetting, -1)) != -1) {
SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SM", 246, szBuf);
statusMask = cfg::getDword(CLVM_MODULE, szSetting, -1);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf);
stickyStatusMask = cfg::getDword(CLVM_MODULE, szSetting, -1);
dwFlags = cfg::getDword(CLVM_MODULE, szBuf, 0);
{
@@ -538,7 +538,7 @@ void UpdateFilters()
Utils::enableDlgControl(clvmHwnd, IDC_LASTMSGVALUE, useLastMsg);
Utils::enableDlgControl(clvmHwnd, IDC_LASTMESSAGEUNIT, useLastMsg);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_LM", 246, szBuf);
lmdat = cfg::getDword(CLVM_MODULE, szSetting, 0);
SetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
@@ -652,15 +652,15 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
char *szBuf = (char*)malloc(iLen + 1);
if (szBuf) {
SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szBuf);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SM", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_VA", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_VA", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
db_unset(NULL, CLVM_MODULE, szBuf);
if (!mir_strcmp(cfg::dat.current_viewmode, szBuf) && mir_strlen(szBuf) == mir_strlen(cfg::dat.current_viewmode)) {
@@ -1048,7 +1048,7 @@ void ApplyViewMode(const char *name)
cfg::dat.bFilterEffective = 0;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name);
+ mir_snprintf(szSetting, "%c%s_PF", 246, name);
if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_strlen(dbv.pszVal) >= 2) {
strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter));
@@ -1057,7 +1057,7 @@ void ApplyViewMode(const char *name)
}
mir_free(dbv.pszVal);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name);
+ mir_snprintf(szSetting, "%c%s_GF", 246, name);
if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_tstrlen(dbv.ptszVal) >= 2) {
_tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, SIZEOF(cfg::dat.groupFilter));
@@ -1066,12 +1066,12 @@ void ApplyViewMode(const char *name)
}
mir_free(dbv.ptszVal);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, name);
+ mir_snprintf(szSetting, "%c%s_SM", 246, name);
cfg::dat.statusMaskFilter = cfg::getDword(CLVM_MODULE, szSetting, -1);
if (cfg::dat.statusMaskFilter >= 1)
cfg::dat.bFilterEffective |= CLVM_FILTER_STATUS;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, name);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, name);
cfg::dat.stickyMaskFilter = cfg::getDword(CLVM_MODULE, szSetting, -1);
if (cfg::dat.stickyMaskFilter != -1)
cfg::dat.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
@@ -1082,7 +1082,7 @@ void ApplyViewMode(const char *name)
if (cfg::dat.filterFlags & CLVM_AUTOCLEAR) {
DWORD timerexpire;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, name);
timerexpire = LOWORD(cfg::getDword(CLVM_MODULE, szSetting, 0));
strncpy(cfg::dat.old_viewmode, cfg::dat.current_viewmode, 256);
cfg::dat.old_viewmode[255] = 0;
@@ -1103,7 +1103,7 @@ void ApplyViewMode(const char *name)
cfg::dat.sortOrder[0] = bSaved;
cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, name);
+ mir_snprintf(szSetting, "%c%s_LM", 246, name);
cfg::dat.lastMsgFilter = cfg::getDword(CLVM_MODULE, szSetting, 0);
if (LOBYTE(HIWORD(cfg::dat.lastMsgFilter)))
cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
index 4f2f4b5afc..7969de2489 100644
--- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp
+++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
@@ -96,17 +96,17 @@ void saveSettingsConnections(struct CONNECTION *connHead)
while (tmp != NULL)
{
- mir_snprintf(buff, SIZEOF(buff), "%dFilterIntIp", i);
+ mir_snprintf(buff, "%dFilterIntIp", i);
db_set_ts(NULL, PLUGINNAME, buff, tmp->strIntIp);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterExtIp", i);
+ mir_snprintf(buff, "%dFilterExtIp", i);
db_set_ts(NULL, PLUGINNAME, buff, tmp->strExtIp);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterPName", i);
+ mir_snprintf(buff, "%dFilterPName", i);
db_set_ws(NULL, PLUGINNAME, buff, tmp->PName);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterIntPort", i);
+ mir_snprintf(buff, "%dFilterIntPort", i);
db_set_dw(NULL, PLUGINNAME, buff, tmp->intIntPort);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterExtPort", i);
+ mir_snprintf(buff, "%dFilterExtPort", i);
db_set_dw(NULL, PLUGINNAME, buff, tmp->intExtPort);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterAction", i);
+ mir_snprintf(buff, "%dFilterAction", i);
db_set_dw(NULL, PLUGINNAME, buff, tmp->Pid);
i++;
tmp = tmp->next;
@@ -126,26 +126,26 @@ struct CONNECTION* LoadSettingsConnections()
for (i = settingFiltersCount - 1; i >= 0; i--)
{
struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
- mir_snprintf(buff, SIZEOF(buff), "%dFilterIntIp", i);
+ mir_snprintf(buff, "%dFilterIntIp", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->strIntIp, dbv.ptszVal, _countof(conn->strIntIp));
db_free(&dbv);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterExtIp", i);
+ mir_snprintf(buff, "%dFilterExtIp", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->strExtIp, dbv.ptszVal, _countof(conn->strExtIp));
db_free(&dbv);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterPName", i);
+ mir_snprintf(buff, "%dFilterPName", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->PName, dbv.ptszVal, _countof(conn->PName));
db_free(&dbv);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterIntPort", i);
+ mir_snprintf(buff, "%dFilterIntPort", i);
conn->intIntPort = db_get_dw(0, PLUGINNAME, buff, -1);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterExtPort", i);
+ mir_snprintf(buff, "%dFilterExtPort", i);
conn->intExtPort = db_get_dw(0, PLUGINNAME, buff, -1);
- mir_snprintf(buff, SIZEOF(buff), "%dFilterAction", i);
+ mir_snprintf(buff, "%dFilterAction", i);
conn->Pid = db_get_dw(0, PLUGINNAME, buff, 0);
conn->next = connHead;
@@ -169,7 +169,7 @@ void LoadSettings()
for (int i = 0; i < STATUS_COUNT; i++)
{
char buff[128];
- mir_snprintf(buff, SIZEOF(buff), "Status%d", i);
+ mir_snprintf(buff, "Status%d", i);
settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
}
//lookupLotusDefaultSettings();
@@ -534,7 +534,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar
for (int i = 0; i < STATUS_COUNT; i++) {
char buff[128];
- mir_snprintf(buff, SIZEOF(buff), "Status%d", i);
+ mir_snprintf(buff, "Status%d", i);
settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE);
db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0);
}
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp
index 0253f5823a..a7aaab2a45 100644
--- a/plugins/CrashDumper/src/exhndlr.cpp
+++ b/plugins/CrashDumper/src/exhndlr.cpp
@@ -29,7 +29,7 @@ int myDebugFilter(unsigned int code, PEXCEPTION_POINTERS ep)
PDelayLoadInfo dlld = (PDelayLoadInfo)ep->ExceptionRecord->ExceptionInformation[0];
char str[256];
- int off = mir_snprintf(str, SIZEOF(str), "dbghelp.dll v.5.0 or later required to provide a crash report\n");
+ int off = mir_snprintf(str, "dbghelp.dll v.5.0 or later required to provide a crash report\n");
off += mir_snprintf(str + off, SIZEOF(str) - off, "Missing Module: %s ", dlld->szDll);
if (dlld->dlp.fImportByName)
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp
index 7e331f37ce..f277c1eec7 100644
--- a/plugins/CrashDumper/src/upload.cpp
+++ b/plugins/CrashDumper/src/upload.cpp
@@ -69,8 +69,8 @@ void OpenAuthUrl(const char* url)
if (user[0] && pass[0]) {
char str[256];
- mir_snprintf(str, SIZEOF(str), url, user); // XXX: fix me
- mir_snprintf(str, SIZEOF(str), "http://vi.miranda-ng.org/detail/%s", user);
+ mir_snprintf(str, url, user); // XXX: fix me
+ mir_snprintf(str, "http://vi.miranda-ng.org/detail/%s", user);
CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)str);
}
else CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)"http://vi.miranda-ng.org/");
@@ -82,7 +82,7 @@ void CreateAuthString(char* auth)
GetLoginStr(user, sizeof(user), pass);
char str[110];
- int len = mir_snprintf(str, SIZEOF(str), "%s:%s", user, pass);
+ int len = mir_snprintf(str, "%s:%s", user, pass);
mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode((PBYTE)str, len)));
}
@@ -205,7 +205,7 @@ void __cdecl VersionInfoUploadThread(void* arg)
char user[64], pass[40];
GetLoginStr(user, sizeof(user), pass);
char str[256];
- mir_snprintf(str, SIZEOF(str), "http://vi.miranda-ng.org/en/upload?login=%s&pass=%s", user, pass);
+ mir_snprintf(str, "http://vi.miranda-ng.org/en/upload?login=%s&pass=%s", user, pass);
InternetDownloadFile(str, trn);
mir_free(trn->buf);
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp
index d201b2cedd..484cbf9340 100644
--- a/plugins/Db3x_mmap/src/dbcontacts.cpp
+++ b/plugins/Db3x_mmap/src/dbcontacts.cpp
@@ -423,7 +423,7 @@ void CDb3Mmap::FillContacts()
cc->pSubs = (MCONTACT*)mir_alloc(cc->nSubs*sizeof(MCONTACT));
for (int i = 0; i < cc->nSubs; i++) {
char setting[100];
- mir_snprintf(setting, SIZEOF(setting), "Handle%d", i);
+ mir_snprintf(setting, "Handle%d", i);
cc->pSubs[i] = (0 != GetContactSetting(dwContactID, META_PROTO, setting, &dbv)) ? NULL : dbv.dVal;
}
}
@@ -461,7 +461,7 @@ void CDb3Mmap::FillContacts()
ccMeta->pSubs[dbv.dVal] = hh;
char setting[100];
- mir_snprintf(setting, SIZEOF(setting), "Handle%d", dbv.dVal);
+ mir_snprintf(setting, "Handle%d", dbv.dVal);
dbws.szSetting = setting;
dbws.value.dVal = hh;
WriteContactSetting(ccMeta->contactID, &dbws);
diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
index 4a4cdc8cd8..52c14c0f32 100644
--- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
+++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
@@ -231,7 +231,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
for (j = 0; j < len; j++)
{
- mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)p[j]);
+ mir_snprintf(tmp, "%02X ", (BYTE)p[j]);
mir_strcat(data, tmp);
}
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index 9c07ce46b7..25d1d4779a 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -91,7 +91,7 @@ void exportModule(MCONTACT hContact, char *module, FILE *file)
data[0] = '\0';
for (int j = 0; j < dbv.cpbVal; j++) {
char tmp[16];
- mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv.pbVal[j]);
+ mir_snprintf(tmp, "%02X ", (BYTE)dbv.pbVal[j]);
mir_strcat(data, tmp);
}
fprintf(file, "\n%s=n%s", setting->name, data);
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp
index d05f2b8cef..ee86cba930 100644
--- a/plugins/DbEditorPP/src/findwindow.cpp
+++ b/plugins/DbEditorPP/src/findwindow.cpp
@@ -612,11 +612,11 @@ void __cdecl FindSettings(LPVOID di)
if (mode) {
if (!replace[0])
- mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found, %d items were deleted."), foundCount, replaceCount);
+ mir_snprintf(szTmp, Translate("Finished. %d items were found, %d items were deleted."), foundCount, replaceCount);
else
- mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found, %d items were replaced."), foundCount, replaceCount);
+ mir_snprintf(szTmp, Translate("Finished. %d items were found, %d items were replaced."), foundCount, replaceCount);
}
- else mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found."), foundCount);
+ else mir_snprintf(szTmp, Translate("Finished. %d items were found."), foundCount);
SendDlgItemMessage(prnthwnd, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)szTmp);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp
index a0f080a974..2f903bb431 100644
--- a/plugins/DbEditorPP/src/settinglist.cpp
+++ b/plugins/DbEditorPP/src/settinglist.cpp
@@ -32,7 +32,7 @@ void saveListSettings(HWND hwnd2List)
for (int i = 0; i <= 3; i++)
if (ListView_GetColumn(hwnd2List, i, &sLC)) {
- mir_snprintf(tmp, SIZEOF(tmp), "Column%dwidth", i);
+ mir_snprintf(tmp, "Column%dwidth", i);
db_set_w(NULL, modname, tmp, (WORD)sLC.cx);
}
}
@@ -122,7 +122,7 @@ void additem(HWND hwnd2Settings, MCONTACT hContact, char* module, char* setting,
data[0] = '\0';
for (int j = 0; j < dbv.cpbVal; j++) {
char tmp[16];
- mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv.pbVal[j]);
+ mir_snprintf(tmp, "%02X ", (BYTE)dbv.pbVal[j]);
mir_strcat(data, tmp);
}
lvi.iImage = 0;
@@ -624,7 +624,7 @@ void EditLabel(HWND hwnd2List, int item, int subitem)
data[0] = '\0';
for (j = 0; j < dbv.cpbVal; j++) {
- mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv.pbVal[j]);
+ mir_snprintf(tmp, "%02X ", (BYTE)dbv.pbVal[j]);
mir_strcat(data, tmp);
}
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index 7474835c98..4059035738 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -92,7 +92,7 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam)
for (j = 0; j < dbv->cpbVal; j++)
{
char tmp[16];
- mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv->pbVal[j]);
+ mir_snprintf(tmp, "%02X ", (BYTE)dbv->pbVal[j]);
mir_strcat(data, tmp);
}
ListView_SetItemText(hwnd2list, index, 4, data);
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index 2af4bebcc1..d18693c2f0 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -138,7 +138,7 @@ bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dial
zipCloseFileInZip(hZip);
}
if (ret) {
- mir_snprintf(buf, SIZEOF(buf), "%s\r\n%s %s %d.%d.%d.%d\r\n",
+ mir_snprintf(buf, "%s\r\n%s %s %d.%d.%d.%d\r\n",
Translate("Miranda NG database"), Translate("Created by:"),
__PLUGIN_NAME, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
}
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index f72ba6de39..24dd3c62c8 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -3,7 +3,7 @@
HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASERVICEOBJ serviceProc, void *obj)
{
char str[MAXMODULELABELLENGTH];
- mir_snprintf(str, SIZEOF(str), "%s%s", MODULE, szService);
+ mir_snprintf(str, "%s%s", MODULE, szService);
str[MAXMODULELABELLENGTH - 1] = 0;
return CreateServiceFunctionObj(str, serviceProc, obj);
}
diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp
index 0baa219117..9d57719211 100644
--- a/plugins/FTPFileYM/src/job_delete.cpp
+++ b/plugins/FTPFileYM/src/job_delete.cpp
@@ -105,9 +105,9 @@ void DeleteJob::run()
char *DeleteJob::getDelFileString()
{
if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, SIZEOF(buff), "rm \"%s/%s\"", ftp->szDir, entry->szFileName);
+ mir_snprintf(buff, "rm \"%s/%s\"", ftp->szDir, entry->szFileName);
else
- mir_snprintf(buff, SIZEOF(buff), "DELE %s", entry->szFileName);
+ mir_snprintf(buff, "DELE %s", entry->szFileName);
return buff;
}
@@ -115,9 +115,9 @@ char *DeleteJob::getDelFileString()
char *DeleteJob::getDelUrlString()
{
if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH)
- mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
+ mir_snprintf(buff, "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
else
- mir_snprintf(buff, SIZEOF(buff), "%s%s/", ftp->getProtoString(), ftp->szServer);
+ mir_snprintf(buff, "%s%s/", ftp->getProtoString(), ftp->szServer);
return buff;
} \ No newline at end of file
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index ace85a52a6..506c704609 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -99,7 +99,7 @@ void UploadJob::copyLinkToML()
{
if (this->hContact != NULL) {
char buff[256];
- mir_snprintf(buff, SIZEOF(buff), "%s\r\n", this->szFileLink);
+ mir_snprintf(buff, "%s\r\n", this->szFileLink);
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)this->hContact, (LPARAM)buff);
}
}
@@ -182,9 +182,9 @@ void UploadJob::start()
char *UploadJob::getChmodString()
{
if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, SIZEOF(buff), "%s \"%s/%s\"", ftp->szChmod, ftp->szDir, this->szSafeFileName);
+ mir_snprintf(buff, "%s \"%s/%s\"", ftp->szChmod, ftp->szDir, this->szSafeFileName);
else
- mir_snprintf(buff, SIZEOF(buff), "%s %s", ftp->szChmod, this->szSafeFileName);
+ mir_snprintf(buff, "%s %s", ftp->szChmod, this->szSafeFileName);
return buff;
}
@@ -192,9 +192,9 @@ char *UploadJob::getChmodString()
char *UploadJob::getDelFileString()
{
if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, SIZEOF(buff), "rm \"%s/%s\"", ftp->szDir, this->szSafeFileName);
+ mir_snprintf(buff, "rm \"%s/%s\"", ftp->szDir, this->szSafeFileName);
else
- mir_snprintf(buff, SIZEOF(buff), "DELE %s", this->szSafeFileName);
+ mir_snprintf(buff, "DELE %s", this->szSafeFileName);
return buff;
}
@@ -202,9 +202,9 @@ char *UploadJob::getDelFileString()
char *UploadJob::getUrlString()
{
if (ftp->szDir[0])
- mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/%s", ftp->getProtoString(), ftp->szServer, ftp->szDir, this->szSafeFileName);
+ mir_snprintf(buff, "%s%s/%s/%s", ftp->getProtoString(), ftp->szServer, ftp->szDir, this->szSafeFileName);
else
- mir_snprintf(buff, SIZEOF(buff), "%s%s/%s", ftp->getProtoString(), ftp->szServer, this->szSafeFileName);
+ mir_snprintf(buff, "%s%s/%s", ftp->getProtoString(), ftp->szServer, this->szSafeFileName);
return buff;
}
@@ -212,9 +212,9 @@ char *UploadJob::getUrlString()
char *UploadJob::getDelUrlString()
{
if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH)
- mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
+ mir_snprintf(buff, "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
else
- mir_snprintf(buff, SIZEOF(buff), "%s%s/", ftp->getProtoString(), ftp->szServer);
+ mir_snprintf(buff, "%s%s/", ftp->getProtoString(), ftp->szServer);
return buff;
}
@@ -316,7 +316,7 @@ void UploadJob::upload()
if (result != CURLE_OK && result != CURLE_ABORTED_BY_CALLBACK) {
char buff[256];
- mir_snprintf(buff, SIZEOF(buff), Translate("FTP error occurred.\n%s"), this->szError);
+ mir_snprintf(buff, Translate("FTP error occurred.\n%s"), this->szError);
Utils::msgBoxA(buff, MB_OK | MB_ICONERROR);
}
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp
index cee488915b..3c6481ba31 100644
--- a/plugins/FTPFileYM/src/manager.cpp
+++ b/plugins/FTPFileYM/src/manager.cpp
@@ -83,7 +83,7 @@ void Manager::initImageList()
for (int i = 0; i < ServerList::FTP_COUNT; i++)
{
- mir_snprintf(buff, SIZEOF(buff), "ftp%d", i);
+ mir_snprintf(buff, "ftp%d", i);
ImageList_AddIcon(himlStates, Utils::loadIconEx(buff));
}
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp
index 4ba9ce13a3..6256b314aa 100644
--- a/plugins/FTPFileYM/src/mir_db.cpp
+++ b/plugins/FTPFileYM/src/mir_db.cpp
@@ -21,56 +21,56 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
int DB::setByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_set_b(hContact, szModule, formSet, iValue);
}
int DB::setWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_set_w(hContact, szModule, formSet, iValue);
}
int DB::setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_set_dw(hContact, szModule, formSet, iValue);
}
int DB::setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_set_s(hContact, szModule, formSet, szValue);
}
int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_set_ts(hContact, szModule, formSet, stzValue);
}
int DB::getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_get_b(hContact, szModule, formSet, iErrorValue);
}
int DB::getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_get_w(hContact, szModule, formSet, iErrorValue);
}
int DB::getDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_get_dw(hContact, szModule, formSet, iErrorValue);
}
@@ -91,7 +91,7 @@ int DB::getAString(MCONTACT hContact, char *szModule, char *szSetting, char *buf
int DB::getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *buff)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return getAString(hContact, szModule, formSet, buff);
}
@@ -112,13 +112,13 @@ int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buf
int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return getString(hContact, szModule, formSet, buff);
}
int DB::deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id)
{
char formSet[256];
- mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
+ mir_snprintf(formSet, szSetting, id);
return db_unset(hContact, szModule, formSet);
}
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp
index 5b7d5396ad..95c677b77c 100644
--- a/plugins/FTPFileYM/src/serverlist.cpp
+++ b/plugins/FTPFileYM/src/serverlist.cpp
@@ -45,7 +45,7 @@ void ServerList::saveToDb() const
ServerList::FTP *ftp = ftpList.getSelected();
char buff[256];
- mir_snprintf(buff, SIZEOF(buff), "Password%d", opt.selected);
+ mir_snprintf(buff, "Password%d", opt.selected);
DB::setAStringF(0, MODULE, buff, opt.selected, ftp->szPass);
DB::setStringF(0, MODULE, "Name%d", opt.selected, ftp->stzName);
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp
index 04d0e185cd..75b5ee1da5 100644
--- a/plugins/FTPFileYM/src/utils.cpp
+++ b/plugins/FTPFileYM/src/utils.cpp
@@ -48,7 +48,7 @@ int Utils::msgBoxA(char *szMsg, UINT uType)
HICON Utils::loadIconEx(char *szName)
{
char buff[100];
- mir_snprintf(buff, SIZEOF(buff), "%s_%s", MODULE, szName);
+ mir_snprintf(buff, "%s_%s", MODULE, szName);
return Skin_GetIcon(buff);
}
@@ -139,7 +139,7 @@ void Utils::curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl
else
curl_easy_setopt(hCurl, CURLOPT_FTPPORT, "-");
- mir_snprintf(buff, SIZEOF(buff), "%s:%s", ftp->szUser, ftp->szPass);
+ mir_snprintf(buff, "%s:%s", ftp->szUser, ftp->szPass);
curl_easy_setopt(hCurl, CURLOPT_USERPWD, buff);
if (ftp->ftpProto == ServerList::FTP::FT_SSL_EXPLICIT || ftp->ftpProto == ServerList::FTP::FT_SSL_IMPLICIT)
diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp
index 14a65dca5c..5e8b839217 100644
--- a/plugins/FavContacts/src/http_api.cpp
+++ b/plugins/FavContacts/src/http_api.cpp
@@ -110,7 +110,7 @@ public:
void Send(int i)
{
char buf[32];
- mir_snprintf(buf, SIZEOF(buf), "%d", i);
+ mir_snprintf(buf, "%d", i);
Send(buf);
}
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index ca8a746957..c958e08dcc 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -443,7 +443,7 @@ void FILEECHO::incomeRequest(char *param)
chunkCountx = atoi(p);
fileSize = atoi(param);
- mir_snprintf(buf, SIZEOF(buf), Translate("Size: %d bytes"), fileSize);
+ mir_snprintf(buf, Translate("Size: %d bytes"), fileSize);
SetDlgItemText(hDlg, IDC_FILENAME, filename);
SetDlgItemText(hDlg, IDC_FILESIZE, buf);
@@ -1167,7 +1167,7 @@ INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
int size = RetrieveFileSize(str);
if (size != -1)
- mir_snprintf(str, SIZEOF(str), Translate("Size: %d bytes"), size);
+ mir_snprintf(str, Translate("Size: %d bytes"), size);
else
mir_strncpy(str, Translate("Can't get a file size"), SIZEOF(str));
SetDlgItemText(hDlg, IDC_FILESIZE, str);
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index ea28a2ba26..cf1157ad3b 100644
--- a/plugins/HTTPServer/src/GuiElements.cpp
+++ b/plugins/HTTPServer/src/GuiElements.cpp
@@ -201,7 +201,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) {
string sCreateLink(const char * pszSrvPath) {
char szTemp[30];
string sLink = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName);
- mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
+ mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
ReplaceAll(sLink, "%LocalIP%", szTemp);
if (sLink.find("%ExternalIP%") != sLink.npos) {
@@ -214,11 +214,11 @@ string sCreateLink(const char * pszSrvPath) {
dwExternalIpAddressGenerated = GetTickCount();
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
+ mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
ReplaceAll(sLink, "%ExternalIP%", szTemp);
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "%d", dwLocalPortUsed, szTemp);
+ mir_snprintf(szTemp, "%d", dwLocalPortUsed, szTemp);
ReplaceAll(sLink, "%Port%", szTemp);
string sSrvPath = pszSrvPath;
@@ -463,7 +463,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) {
DWORD dwError = CommDlgExtendedError();
if (dwError) {
char szTemp[200];
- mir_snprintf(szTemp, SIZEOF(szTemp), "Failed to create File Open dialog the error returned was %d", dwError);
+ mir_snprintf(szTemp, "Failed to create File Open dialog the error returned was %d", dwError);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
}
return false;
@@ -560,7 +560,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) {
ListView_InsertItem(hShareList, &sItem);
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d", pclCur->st.nMaxDownloads);
+ mir_snprintf(szTmp, "%d", pclCur->st.nMaxDownloads);
sItem.iSubItem = 1;
sItem.pszText = szTmp;
ListView_SetItem(hShareList, &sItem);
@@ -600,7 +600,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) {
ListView_SetItem(hUserList, &sItem);
if (pclCurUser->dwTotalSize) {
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
+ mir_snprintf(szTmp, "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
} else {
mir_strcpy(szTmp, "? %%");
}
@@ -612,9 +612,9 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) {
if (dwSpeed > 10000) {
dwSpeed += 512; // make sure we round ot down correctly.
dwSpeed /= 1024;
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d KB/Sec", dwSpeed);
+ mir_snprintf(szTmp, "%d KB/Sec", dwSpeed);
} else {
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d B/Sec", dwSpeed);
+ mir_snprintf(szTmp, "%d B/Sec", dwSpeed);
}
sItem.iSubItem = 4;
sItem.pszText = szTmp;
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index f63d31db5a..d89e8a4588 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -643,7 +643,7 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) {
hDirectBoundPort = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM) & nlb);
if (!hDirectBoundPort) {
TCHAR szTemp[200];
- mir_snprintf(szTemp, SIZEOF(szTemp), TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") ,
+ mir_snprintf(szTemp, TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") ,
nlb.wPort == 80 ? "80" : nus.szIncomingPorts);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
return 1001;
diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp
index b8264298bb..46c079293b 100644
--- a/plugins/IEView/src/ChatHTMLBuilder.cpp
+++ b/plugins/IEView/src/ChatHTMLBuilder.cpp
@@ -50,29 +50,29 @@ void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
int style;
DBVARIANT dbv;
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = db_get_dw(NULL, CHATFONTMOD, str, 0x000000);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, CHATFONTMOD, str, 10);
lf->lfHeight = abs(lf->lfHeight);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
+ mir_snprintf(str, "Font%dSty", i);
style = db_get_b(NULL, CHATFONTMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, CHATFONTMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%d", i);
+ mir_snprintf(str, "Font%d", i);
if (db_get(NULL, CHATFONTMOD, str, &dbv))
mir_strcpy(lf->lfFaceName, "Verdana");
else {
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp
index 3a4031f2ec..611d7c74de 100644
--- a/plugins/IEView/src/HTMLBuilder.cpp
+++ b/plugins/IEView/src/HTMLBuilder.cpp
@@ -205,7 +205,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
mir_free(ci.pszVal);
break;
case CNFT_DWORD:
- mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
+ mir_snprintf(buf, "%u", ci.dVal);
break;
}
}
@@ -219,7 +219,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
mir_free(ci.pszVal);
break;
case CNFT_DWORD:
- mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
+ mir_snprintf(buf, "%u", ci.dVal);
break;
}
}
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp
index 03c083eaef..513e8eb9ae 100644
--- a/plugins/IEView/src/HistoryHTMLBuilder.cpp
+++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp
@@ -100,34 +100,34 @@ void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, CO
int style;
DBVARIANT dbv;
if (bkgColour) {
- mir_snprintf(str, SIZEOF(str), "Back.%s", dbSetting);
+ mir_snprintf(str, "Back.%s", dbSetting);
*bkgColour = db_get_dw(NULL, HPPMOD, str, 0xFFFFFF);
}
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font.%s.Color", dbSetting);
+ mir_snprintf(str, "Font.%s.Color", dbSetting);
*colour = db_get_dw(NULL, HPPMOD, str, 0x000000);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font.%s.Size", dbSetting);
+ mir_snprintf(str, "Font.%s.Size", dbSetting);
lf->lfHeight = (char)db_get_b(NULL, HPPMOD, str, 10);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font.%s.Style.Bold", dbSetting);
+ mir_snprintf(str, "Font.%s.Style.Bold", dbSetting);
style = db_get_b(NULL, HPPMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
- mir_snprintf(str, SIZEOF(str), "Font.%s.Style.Italic", dbSetting);
+ mir_snprintf(str, "Font.%s.Style.Italic", dbSetting);
style = db_get_b(NULL, HPPMOD, str, 0) << 1;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "Font.%s.Charset", dbSetting);
+ mir_snprintf(str, "Font.%s.Charset", dbSetting);
lf->lfCharSet = db_get_b(NULL, HPPMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font.%s.Name", dbSetting);
+ mir_snprintf(str, "Font.%s.Name", dbSetting);
if (db_get(NULL, HPPMOD, str, &dbv))
mir_strcpy(lf->lfFaceName, "Verdana");
else {
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp
index dc34b47dca..c34e794f41 100644
--- a/plugins/IEView/src/MUCCHTMLBuilder.cpp
+++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp
@@ -46,29 +46,29 @@ void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
int style;
DBVARIANT dbv;
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = db_get_dw(NULL, MUCCMOD, str, 0x000000);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, MUCCMOD, str, 10);
lf->lfHeight = abs(lf->lfHeight);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dStyle", i);
+ mir_snprintf(str, "Font%dStyle", i);
style = db_get_b(NULL, MUCCMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, MUCCMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%dFace", i);
+ mir_snprintf(str, "Font%dFace", i);
if (db_get(NULL, MUCCMOD, str, &dbv))
mir_strcpy(lf->lfFaceName, "Verdana");
else {
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp
index 8d9e6aa737..ec87e8877c 100644
--- a/plugins/IEView/src/ScriverHTMLBuilder.cpp
+++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp
@@ -88,29 +88,29 @@ void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
int style;
DBVARIANT dbv;
if (colour) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dCol", i);
+ mir_snprintf(str, "SRMFont%dCol", i);
*colour = db_get_dw(NULL, SRMMMOD, str, 0x000000);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSize", i);
+ mir_snprintf(str, "SRMFont%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, 10);
lf->lfHeight = abs(lf->lfHeight);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSty", i);
+ mir_snprintf(str, "SRMFont%dSty", i);
style = db_get_b(NULL, SRMMMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
+ mir_snprintf(str, "SRMFont%dSet", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "SRMFont%d", i);
+ mir_snprintf(str, "SRMFont%d", i);
if (db_get(NULL, SRMMMOD, str, &dbv))
mir_strcpy(lf->lfFaceName, "Verdana");
else {
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
index d64d1851d7..aa08a7b73a 100644
--- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
+++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
@@ -117,31 +117,31 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
int style;
DBVARIANT dbv;
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = db_get_dw(NULL, TABSRMM_FONTMODULE, str, 0x000000);
}
if (lf) {
HDC hdc = GetDC(NULL);
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, TABSRMM_FONTMODULE, str, 10);
ReleaseDC(NULL, hdc);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
+ mir_snprintf(str, "Font%dSty", i);
style = db_get_b(NULL, TABSRMM_FONTMODULE, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, TABSRMM_FONTMODULE, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%d", i);
+ mir_snprintf(str, "Font%d", i);
if (db_get(NULL, TABSRMM_FONTMODULE, str, &dbv))
mir_strcpy(lf->lfFaceName, "Verdana");
else {
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 0e1094cd17..9002b5baab 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -504,7 +504,7 @@ BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
else
{
char setting[256];
- mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto);
+ mir_snprintf(setting, "%sEnabled", proto);
return (BOOL) db_get_b(NULL, MODULE_NAME, setting, FALSE);
}
}
@@ -708,7 +708,7 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled)
return 0;
char setting[256];
- mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto);
+ mir_snprintf(setting, "%sEnabled", proto);
db_set_b(NULL, MODULE_NAME, setting, enabled);
// Modify menu info
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp
index a83b42f0a5..f508c27906 100644
--- a/plugins/LotusNotify/src/LotusNotify.cpp
+++ b/plugins/LotusNotify/src/LotusNotify.cpp
@@ -1027,7 +1027,7 @@ void LoadSettings()
for(int i = 0; i < STATUS_COUNT; i++) {
char buff[128];
- mir_snprintf(buff, SIZEOF(buff), "LNStatus%d", i);
+ mir_snprintf(buff, "LNStatus%d", i);
settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
}
//lookupLotusDefaultSettings();
@@ -1291,7 +1291,7 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
db_set_b(NULL, PLUGINNAME, "LNIniAnswer", settingIniAnswer);
for(int i = 0; i < STATUS_COUNT ; i++){
- mir_snprintf(buff, SIZEOF(buff), "LNStatus%d", i);
+ mir_snprintf(buff, "LNStatus%d", i);
settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE);
db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0);
}
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index b75ad82428..3a97fb52fb 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -602,9 +602,9 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam)
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (!pa->bOldProto)
- mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", pa->szProtoName, szID);
+ mir_snprintf(buffer, "%s: %s", pa->szProtoName, szID);
else
- mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", szProto, szID);
+ mir_snprintf(buffer, "%s: %s", szProto, szID);
}
else
strncpy(buffer, szID, SIZEOF(buffer)-1);
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp
index b4615bc689..5414ab4568 100644
--- a/plugins/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/src/utils.cpp
@@ -327,7 +327,7 @@ void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) {
void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg) {
char buff[1024];
- mir_snprintf(buff, SIZEOF(buff), "%s%s", LANG_INLINE_PREFIX, msg);
+ mir_snprintf(buff, "%s%s", LANG_INLINE_PREFIX, msg);
PROTORECVEVENT pre = {0};
pre.timestamp = time(0);
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index 299ff0b2dd..3b11046a5e 100755
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -1292,7 +1292,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa
for (int i = 0; i < nCount; i++)
{
- mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", proto[i]->szModuleName);
+ mir_snprintf(szTemp, "DisableProt_%s", proto[i]->szModuleName);
sItem.pszText = proto[i]->szModuleName;
sItem.iImage = db_get_b(NULL, MODULE, szTemp, 1);
::SendMessage(hMapUser, LVM_INSERTITEMA, 0, (LPARAM)&sItem);
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 528ff489d5..ac9781fa49 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -1426,7 +1426,7 @@ int nExportEvent(WPARAM hContact, LPARAM hDbEvent)
if (!db_event_get(hDbEvent, &dbei)) {
char szTemp[500];
- mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", dbei.szModule);
+ mir_snprintf(szTemp, "DisableProt_%s", dbei.szModule);
if (db_get_b(NULL, MODULE, szTemp, 1))
ExportDBEventInfo(hContact, dbei);
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 90acfb1646..f8f56fe5fc 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -405,7 +405,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
if (!opt.FromOffline || oldStatus != ID_STATUS_OFFLINE) { // Either it wasn't a change from Offline or we didn't enable that.
char buff[8];
- mir_snprintf(buff, SIZEOF(buff), "%d", newStatus);
+ mir_snprintf(buff, "%d", newStatus);
if (db_get_b(0, MODULE, buff, 1) == 0)
return 0; // "Notify when a contact changes to one of..." is unchecked
}
@@ -803,7 +803,7 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam)
if (opt.AutoDisable && (!opt.OnlyGlobalChanges || szProto == NULL)) {
if (opt.DisablePopupGlobally && ServiceExists(MS_POPUP_QUERY)) {
char szSetting[12];
- mir_snprintf(szSetting, SIZEOF(szSetting), "p%d", wParam);
+ mir_snprintf(szSetting, "p%d", wParam);
BYTE hlpDisablePopup = db_get_b(0, MODULE, szSetting, 0);
if (hlpDisablePopup != opt.PopupAutoDisabled) {
@@ -827,7 +827,7 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam)
if (opt.DisableSoundGlobally) {
char szSetting[12];
- mir_snprintf(szSetting, SIZEOF(szSetting), "s%d", wParam);
+ mir_snprintf(szSetting, "s%d", wParam);
BYTE hlpDisableSound = db_get_b(0, MODULE, szSetting, 0);
if (hlpDisableSound != opt.SoundAutoDisabled) {
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp
index 1952dd4e2f..fdd9a14aa3 100644
--- a/plugins/NewXstatusNotify/src/options.cpp
+++ b/plugins/NewXstatusNotify/src/options.cpp
@@ -135,9 +135,9 @@ void SaveTemplates()
for (int i = 0; i < ProtoTemplates.getCount(); i++) {
PROTOTEMPLATE *prototemplate = ProtoTemplates[i];
char str[MAX_PATH];
- mir_snprintf(str, SIZEOF(str), "%s_TPopupSMsgChanged", prototemplate->ProtoName);
+ mir_snprintf(str, "%s_TPopupSMsgChanged", prototemplate->ProtoName);
db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateMsg);
- mir_snprintf(str, SIZEOF(str), "%s_TPopupSMsgRemoved", prototemplate->ProtoName);
+ mir_snprintf(str, "%s_TPopupSMsgRemoved", prototemplate->ProtoName);
db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateRemoved);
}
}
@@ -428,12 +428,12 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
ctlColour = SendDlgItemMessage(hwndDlg, (i + 2000), CPM_GETCOLOUR, 0, 0);
StatusList[Index(i)].colorBack = SendDlgItemMessage(hwndDlg, (i + 2000), CPM_GETCOLOUR, 0, 0);
- mir_snprintf(str, SIZEOF(str), "%ibg", i);
+ mir_snprintf(str, "%ibg", i);
db_set_dw(0, MODULE, str, ctlColour);
ctlColour = SendDlgItemMessage(hwndDlg, (i + 1000), CPM_GETCOLOUR, 0, 0);
StatusList[Index(i)].colorText = ctlColour;
- mir_snprintf(str, SIZEOF(str), "%itx", i);
+ mir_snprintf(str, "%itx", i);
db_set_dw(0, MODULE, str, ctlColour);
}
@@ -480,13 +480,13 @@ INT_PTR CALLBACK DlgProcAutoDisableOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "p%d", i);
+ mir_snprintf(str, "p%d", i);
CheckDlgButton(hwndDlg, i, db_get_b(0, MODULE, str, 0) ? BST_CHECKED : BST_UNCHECKED);
}
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "s%d", i);
+ mir_snprintf(str, "s%d", i);
CheckDlgButton(hwndDlg, (i + 2000), db_get_b(NULL, MODULE, str, 0) ? BST_CHECKED : BST_UNCHECKED);
}
@@ -500,13 +500,13 @@ INT_PTR CALLBACK DlgProcAutoDisableOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "p%d", i);
+ mir_snprintf(str, "p%d", i);
db_set_b(NULL, MODULE, str, IsDlgButtonChecked(hwndDlg, i));
}
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "s%d", i);
+ mir_snprintf(str, "s%d", i);
db_set_b(NULL, MODULE, str, IsDlgButtonChecked(hwndDlg, i + 2000));
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp
index e39af13d61..88bb66a8e7 100644
--- a/plugins/NewXstatusNotify/src/xstatus.cpp
+++ b/plugins/NewXstatusNotify/src/xstatus.cpp
@@ -172,7 +172,7 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc)
case TYPE_JABBER_ACTIVITY:
DBVARIANT dbv;
char szSetting[64];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
+ mir_snprintf(szSetting, "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
if (!db_get_s(xsc->hContact, "AdvStatus", szSetting, &dbv)) {
hIcon = Skin_GetIcon(dbv.pszVal);
db_free(&dbv);
@@ -235,7 +235,7 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc)
switch (xsc->type) {
case TYPE_JABBER_MOOD:
case TYPE_JABBER_ACTIVITY:
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
+ mir_snprintf(szSetting, "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
if (!db_get_s(xsc->hContact, "AdvStatus", szSetting, &dbv)) {
hIcon = Skin_GetIcon(dbv.pszVal);
db_free(&dbv);
@@ -351,7 +351,7 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc)
BOOL bEnablePopup = true, bEnableSound = true, bEnableLog = opt.XLogToDB;
char buff[12] = { 0 };
- mir_snprintf(buff, SIZEOF(buff), "%d", ID_STATUS_EXTRASTATUS);
+ mir_snprintf(buff, "%d", ID_STATUS_EXTRASTATUS);
if ((db_get_b(0, MODULE, buff, 1) == 0)
|| (db_get_w(xsc->hContact, xsc->szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
|| (!opt.HiddenContactsToo && (db_get_b(xsc->hContact, "CList", "Hidden", 0) == 1))
@@ -452,7 +452,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch
char szSetting[128];
buff[0] = 0;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
+ mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) {
_tcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 21815bd625..3b9f390634 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -1412,21 +1412,21 @@ void ExportGpGKeysFunc(int type)
case DBVT_BYTE:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal);
+ mir_snprintf(_id, "%d", dbv.bVal);
id += _id;
}
break;
case DBVT_WORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal);
+ mir_snprintf(_id, "%d", dbv.wVal);
id += _id;
}
break;
case DBVT_DWORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal);
+ mir_snprintf(_id, "%d", dbv.dVal);
id += _id;
}
break;
@@ -1463,21 +1463,21 @@ void ExportGpGKeysFunc(int type)
case DBVT_BYTE:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal);
+ mir_snprintf(_id, "%d", dbv.bVal);
id += _id;
}
break;
case DBVT_WORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal);
+ mir_snprintf(_id, "%d", dbv.wVal);
id += _id;
}
break;
case DBVT_DWORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal);
+ mir_snprintf(_id, "%d", dbv.dVal);
id += _id;
}
break;
@@ -1616,7 +1616,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
case DBVT_BYTE:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal);
+ mir_snprintf(_id, "%d", dbv.bVal);
id += _id;
if(id == login)
acc = accs[i]->szModuleName;
@@ -1625,7 +1625,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
case DBVT_WORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal);
+ mir_snprintf(_id, "%d", dbv.wVal);
id += _id;
if(id == login)
acc = accs[i]->szModuleName;
@@ -1634,7 +1634,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
case DBVT_DWORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal);
+ mir_snprintf(_id, "%d", dbv.dVal);
id += _id;
if(id == login)
acc = accs[i]->szModuleName;
@@ -1685,7 +1685,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
case DBVT_BYTE:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal);
+ mir_snprintf(_id, "%d", dbv.bVal);
id += _id;
if(id == contact_id)
found = true;
@@ -1694,7 +1694,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
case DBVT_WORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal);
+ mir_snprintf(_id, "%d", dbv.wVal);
id += _id;
if(id == contact_id)
found = true;
@@ -1703,7 +1703,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
case DBVT_DWORD:
{
char _id[64];
- mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal);
+ mir_snprintf(_id, "%d", dbv.dVal);
id += _id;
if(id == contact_id)
found = true;
diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp
index 5d3a56b645..1cfe612b5a 100644
--- a/plugins/NewsAggregator/Src/Authentication.cpp
+++ b/plugins/NewsAggregator/Src/Authentication.cpp
@@ -36,7 +36,7 @@ void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg)
char *user = mir_t2a(tlogin), *pass = mir_t2a(tpass);
char str[MAX_PATH];
- int len = mir_snprintf(str, SIZEOF(str), "%s:%s", user, pass);
+ int len = mir_snprintf(str, "%s:%s", user, pass);
mir_free(user);
mir_free(pass);
mir_free(tlogin);
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp
index af83f83cb5..ff3e1795e6 100644
--- a/plugins/Non-IM Contact/src/contactinfo.cpp
+++ b/plugins/Non-IM Contact/src/contactinfo.cpp
@@ -588,23 +588,23 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam)
if (icon) {
char tmp[64];
if (icon == ID_STATUS_ONLINE)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: Online\r\n");
+ mir_snprintf(tmp, "Icon: Online\r\n");
else if (icon == ID_STATUS_AWAY)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: Away\r\n");
+ mir_snprintf(tmp, "Icon: Away\r\n");
else if (icon == ID_STATUS_NA)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: NA\r\n");
+ mir_snprintf(tmp, "Icon: NA\r\n");
else if (icon == ID_STATUS_DND)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: DND\r\n");
+ mir_snprintf(tmp, "Icon: DND\r\n");
else if (icon == ID_STATUS_OCCUPIED)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: Occupied\r\n");
+ mir_snprintf(tmp, "Icon: Occupied\r\n");
else if (icon == ID_STATUS_FREECHAT)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: Free For Chat\r\n");
+ mir_snprintf(tmp, "Icon: Free For Chat\r\n");
else if (icon == ID_STATUS_INVISIBLE)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: Invisible\r\n");
+ mir_snprintf(tmp, "Icon: Invisible\r\n");
else if (icon == ID_STATUS_ONTHEPHONE)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: On The Phone\r\n");
+ mir_snprintf(tmp, "Icon: On The Phone\r\n");
else if (icon == ID_STATUS_OUTTOLUNCH)
- mir_snprintf(tmp, SIZEOF(tmp), "Icon: Out To Lunch\r\n");
+ mir_snprintf(tmp, "Icon: Out To Lunch\r\n");
else {
free(msg);
continue;
@@ -620,7 +620,7 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam)
if (minutes)
mir_strcpy(tmp2, "Minutes");
else mir_strcpy(tmp2, "Seconds");
- mir_snprintf(tmp, SIZEOF(tmp), "UseTimer: Yes\r\nTimer: %d %s", timer, tmp2);
+ mir_snprintf(tmp, "UseTimer: Yes\r\nTimer: %d %s", timer, tmp2);
char *msgtemp = (char*)realloc(msg, mir_strlen(msg) + mir_strlen(tmp) + 1);
if (msgtemp) {
msg = msgtemp;
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp
index 5f7044cf12..677f2d2455 100644
--- a/plugins/Non-IM Contact/src/files.cpp
+++ b/plugins/Non-IM Contact/src/files.cpp
@@ -75,7 +75,7 @@ void reloadFiles(HWND fileList)
char file[MAX_PATH], fn[6];
SendMessage(fileList, CB_RESETCONTENT, 0, 0);
for (i = 0;; i++) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
if (db_get_static(NULL, MODNAME, fn, file, SIZEOF(file))) {
index = SendMessageA(fileList, CB_ADDSTRING, 0, (LPARAM)file);
SendMessage(fileList, CB_SETITEMDATA, index, (LPARAM)i);
@@ -104,7 +104,7 @@ void readFile(HWND hwnd)
int lineNumber, fileLength = 0, width = 0;
char temp[MAX_STRING_LENGTH], szFileName[512], temp1[MAX_STRING_LENGTH], fn[8];
int fileNumber = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0);
- mir_snprintf(fn, SIZEOF(fn), "fn%d", fileNumber);
+ mir_snprintf(fn, "fn%d", fileNumber);
if (!db_get_static(NULL, MODNAME, fn, szFileName, SIZEOF(szFileName))) {
msg(Translate("File couldn't be opened"), fn);
return;
@@ -147,12 +147,12 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
reloadFiles(GetDlgItem(hwnd, IDC_FILE_LIST));
{
int i = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0);
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
SendDlgItemMessage(hwnd, IDC_FILE_CONTENTS, LB_RESETCONTENT, 0, 0);
if (db_get_static(NULL, MODNAME, fn, string, SIZEOF(string))) {
if ((!strncmp("http://", string, mir_strlen("http://"))) || (!strncmp("https://", string, mir_strlen("https://")))) {
SetDlgItemTextA(hwnd, IDC_URL, string);
- mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i);
+ mir_snprintf(fn, "fn%d_timer", i);
SetDlgItemTextA(hwnd, IDC_WWW_TIMER, _itoa(db_get_w(NULL, MODNAME, fn, 60), tmp, 10));
}
readFile(hwnd);
@@ -176,13 +176,13 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
mir_strcpy(url, text);
if (!InternetDownloadFile(text)) {
for (i = 0;; i++) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
if (!db_get_static(NULL, MODNAME, fn, text, SIZEOF(text)))
break;
}
mir_snprintf(szFileName, SIZEOF(szFileName), "%s\\plugins\\%s.html", getMimDir(temp), fn);
if (savehtml(szFileName)) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
db_set_s(NULL, MODNAME, fn, url);
if (!GetWindowTextLength(GetDlgItem(hwnd, IDC_WWW_TIMER)))
timer = 60;
@@ -190,7 +190,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemTextA(hwnd, IDC_WWW_TIMER, text, SIZEOF(text));
timer = atoi(text);
}
- mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i);
+ mir_snprintf(fn, "fn%d_timer", i);
db_set_w(NULL, MODNAME, fn, (WORD)timer);
SendMessage(hwnd, WM_RELOADWINDOW, 0, 0);
}
@@ -206,7 +206,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int i, index;
char file[MAX_PATH], fn[6];
for (i = 0;; i++) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
if (!db_get_static(NULL, MODNAME, fn, file, SIZEOF(file)))
break;
}
@@ -216,7 +216,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_SETITEMDATA, index, (LPARAM)i);
SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_SETCURSEL, index, 0);
SetDlgItemTextA(hwnd, IDC_FN, _itoa(i, fn, 10));
- mir_snprintf(fn, SIZEOF(fn), "fn%d", index);
+ mir_snprintf(fn, "fn%d", index);
readFile(hwnd);
}
break;
@@ -227,7 +227,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int index = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0), i = (int)SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETITEMDATA, index, 0);
int count = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCOUNT, 0, 0) - 1;
if (index == count) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", index);
+ mir_snprintf(fn, "fn%d", index);
db_unset(NULL, MODNAME, fn);
SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_DELETESTRING, index, 0);
SendMessage(hwnd, WM_RELOADWINDOW, 0, 0);
@@ -238,13 +238,13 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
else {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
while (db_get_static(NULL, MODNAME, fn, tmp, SIZEOF(tmp))) {
- mir_snprintf(fn1, SIZEOF(fn1), "fn%d", i - 1);
+ mir_snprintf(fn1, "fn%d", i - 1);
db_set_s(NULL, MODNAME, fn1, tmp);
- mir_snprintf(fn, SIZEOF(fn), "fn%d", ++i);
+ mir_snprintf(fn, "fn%d", ++i);
}
- mir_snprintf(fn, SIZEOF(fn), "fn%d", --i);
+ mir_snprintf(fn, "fn%d", --i);
db_unset(NULL, MODNAME, fn);
SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_DELETESTRING, index, 0);
SendMessage(hwnd, WM_RELOADWINDOW, 0, 0);
@@ -257,11 +257,11 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int index = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0);
char fn[20], tmp[MAX_PATH];
SetDlgItemTextA(hwnd, IDC_FN, _itoa(index, fn, 10));
- mir_snprintf(fn, SIZEOF(fn), "fn%d", index);
+ mir_snprintf(fn, "fn%d", index);
if (db_get_static(NULL, MODNAME, fn, tmp, SIZEOF(tmp))) {
if (!strncmp("http://", tmp, mir_strlen("http://")) || !strncmp("https://", tmp, mir_strlen("https://"))) {
SetDlgItemTextA(hwnd, IDC_URL, tmp);
- mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", index);
+ mir_snprintf(fn, "fn%d_timer", index);
SetDlgItemTextA(hwnd, IDC_WWW_TIMER, _itoa(db_get_w(NULL, MODNAME, fn, 60), tmp, 10));
}
else {
@@ -287,7 +287,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int i = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0);
int timer;
char fn[MAX_PATH], string[1000];
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_WWW_TIMER))) {
TCHAR text[5];
GetDlgItemText(hwnd, IDC_WWW_TIMER, text, SIZEOF(text));
@@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (db_get_static(NULL, MODNAME, fn, string, SIZEOF(string)))
if (!strncmp("http://", string, mir_strlen("http://")) || !strncmp("https://", string, mir_strlen("https://"))) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i);
+ mir_snprintf(fn, "fn%d_timer", i);
db_set_w(NULL, MODNAME, fn, (WORD)timer);
}
diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp
index 4b9c4449d8..456fc8d86e 100644
--- a/plugins/Non-IM Contact/src/namereplacing.cpp
+++ b/plugins/Non-IM Contact/src/namereplacing.cpp
@@ -398,7 +398,7 @@ int lastChecked(CMStringA &szNewStr, const char *str)
int file;
char tszFileName[MAX_PATH], temp[MAX_PATH], szSetting[20];
sscanf(&str[cbPattern], "%d", &file);
- mir_snprintf(szSetting, SIZEOF(szSetting), "fn%d", file);
+ mir_snprintf(szSetting, "fn%d", file);
char *szVar = db_get_sa(NULL, MODNAME, szSetting);
if (szVar == NULL)
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp
index a3195ecad3..cbd5ba7f29 100644
--- a/plugins/Non-IM Contact/src/timer.cpp
+++ b/plugins/Non-IM Contact/src/timer.cpp
@@ -23,12 +23,12 @@ void timerFunc(void *di)
/* update the web pages*/
for (int i = 0;; i++) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d", i);
+ mir_snprintf(fn, "fn%d", i);
if (!db_get_static(NULL, MODNAME, fn, text, SIZEOF(text)))
break;
if (!strncmp("http://", text, mir_strlen("http://")) || !strncmp("https://", text, mir_strlen("https://"))) {
- mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i);
+ mir_snprintf(fn, "fn%d_timer", i);
int timer = db_get_w(NULL, MODNAME, fn, 60);
if (timer && !(timerCount % timer)) {
if (!InternetDownloadFile(text)) {
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp
index 20ac2bab12..f80376d434 100644
--- a/plugins/NotesAndReminders/src/options.cpp
+++ b/plugins/NotesAndReminders/src/options.cpp
@@ -242,7 +242,7 @@ void RegisterFontServiceFonts()
for (int i = 0; i < SIZEOF(fontOptionsList); i++)
{
fontid.order = i;
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i);
+ mir_snprintf(szTemp, "Font%d", i);
strncpy(fontid.prefix, szTemp, SIZEOF(fontid.prefix));
_tcsncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
fontid.deffontsettings.colour = fontOptionsList[i].defColour;
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index 719c25afec..7f743492cd 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -1257,9 +1257,9 @@ static int ReformatTimeInputEx(HWND Dialog, UINT nIDTime, UINT nIDRefTime, int h
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
+ mir_snprintf(buf, "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
else
- mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
+ mir_snprintf(buf, "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
// search for preset
n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf);
@@ -1282,7 +1282,7 @@ static int ReformatTimeInputEx(HWND Dialog, UINT nIDTime, UINT nIDRefTime, int h
//
- mir_snprintf(buf, SIZEOF(buf), "%02d:%02d", h, m);
+ mir_snprintf(buf, "%02d:%02d", h, m);
// search for preset first
n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf);
@@ -1368,9 +1368,9 @@ output_result:
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
+ mir_snprintf(buf, "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
else
- mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
+ mir_snprintf(buf, "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
}
}
else
@@ -1389,7 +1389,7 @@ output_result:
if ((int)Date.wHour != h || (int)Date.wMinute != m)
{
- mir_snprintf(buf, SIZEOF(buf), "%02d:%02d", (UINT)Date.wHour, (UINT)Date.wMinute);
+ mir_snprintf(buf, "%02d:%02d", (UINT)Date.wHour, (UINT)Date.wMinute);
// search for preset again
n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf);
@@ -1684,12 +1684,12 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP
if (h)
{
LPCSTR lpszHours = Translate("Hours");
- mir_snprintf(buf, SIZEOF(buf), "%d:%02d %s", h, m, lpszHours);
+ mir_snprintf(buf, "%d:%02d %s", h, m, lpszHours);
}
else
{
LPCSTR lpszMinutes = Translate("Minutes");
- mir_snprintf(buf, SIZEOF(buf), "%d %s", m, lpszMinutes);
+ mir_snprintf(buf, "%d %s", m, lpszMinutes);
}
SetDlgItemText(Dialog, IDC_REMINDAGAININ, buf);
}
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index b515b3dbff..4c554c263c 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -505,7 +505,7 @@ void Nudge_ShowStatus(CNudgeElement *n, MCONTACT hContact, DWORD timestamp)
void Nudge_AddAccount(PROTOACCOUNT *proto)
{
char str[MAXMODULELABELLENGTH + 10];
- mir_snprintf(str, SIZEOF(str), "%s/Nudge", proto->szModuleName);
+ mir_snprintf(str, "%s/Nudge", proto->szModuleName);
HANDLE hevent = HookEvent(str, NudgeReceived);
if (hevent == NULL)
return;
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp
index 66e3601d8b..56a35e8ecf 100644
--- a/plugins/PackUpdater/Src/Options.cpp
+++ b/plugins/PackUpdater/Src/Options.cpp
@@ -64,7 +64,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
}
else {
for (int i = 1; i < POPUPS; i++) {
- mir_snprintf(str, SIZEOF(str), "Popups%dM", i);
+ mir_snprintf(str, "Popups%dM", i);
CheckDlgButton(hwndDlg, (i + 1029), (db_get_b(NULL, MODNAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
}
}
@@ -148,7 +148,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
db_set_b(NULL, MODNAME, "Reminder", Reminder);
if (!ServiceExists(MS_POPUP_ADDPOPUPT)) {
for (int i = 1; i < POPUPS; i++) {
- mir_snprintf(str, SIZEOF(str), "Popups%dM", i);
+ mir_snprintf(str, "Popups%dM", i);
db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i + 1029))));
}
}
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hdlg, IDC_RC, CB_SETCURSEL, MyOptions.RightClickAction, 0);
//Popups nitified
for (i = 0; i < POPUPS; i++) {
- mir_snprintf(str, SIZEOF(str), "Popups%d", i);
+ mir_snprintf(str, "Popups%d", i);
mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i);
CheckDlgButton(hdlg, (i + 40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, (i + 1024), (db_get_b(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
@@ -353,11 +353,11 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
for (i = 0; i <= POPUPS - 1; i++) {
ctlColor = SendDlgItemMessage(hdlg, (i + 42071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorBack = ctlColor;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iBg", i);
+ mir_snprintf(szSetting, "Popups%iBg", i);
db_set_dw(NULL, MODNAME, szSetting, ctlColor);
ctlColor = SendDlgItemMessage(hdlg, (i + 41071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorText = ctlColor;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iTx", i);
+ mir_snprintf(szSetting, "Popups%iTx", i);
db_set_dw(NULL, MODNAME, szSetting, ctlColor);
}
//Colors
@@ -371,7 +371,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
db_set_b(NULL, MODNAME, "RightClickAction", MyOptions.RightClickAction);
//Notified popups
for (i = 0; i < POPUPS; i++) {
- mir_snprintf(str, SIZEOF(str), "Popups%d", i);
+ mir_snprintf(str, "Popups%d", i);
db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071))));
mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i);
db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024))));
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp
index 64be901181..3dd8c82452 100644
--- a/plugins/Ping/src/pinggraph.cpp
+++ b/plugins/Ping/src/pinggraph.cpp
@@ -231,7 +231,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
WindowData *wd = (WindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
{
char buff[30];
- mir_snprintf(buff, SIZEOF(buff), "pinggraphwnd%d", wd->item_id);
+ mir_snprintf(buff, "pinggraphwnd%d", wd->item_id);
Utils_SaveWindowPosition(hwnd, 0, PLUG, buff);
}
}
@@ -241,7 +241,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
WindowData *wd = (WindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
{
char buff[30];
- mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", wd->item_id);
+ mir_snprintf(buff, "WindowHandle%d", wd->item_id);
db_set_dw(0, PLUG, buff, 0);
}
delete wd;
@@ -254,7 +254,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) {
char buff[30];
- mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", (DWORD)wParam);
+ mir_snprintf(buff, "WindowHandle%d", (DWORD)wParam);
HWND hGraphWnd = (HWND)db_get_dw(0, PLUG, buff, 0);
if (hGraphWnd) {
ShowWindow(hGraphWnd, SW_SHOW);
@@ -298,7 +298,7 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) {
SetWindowLongPtr(hGraphWnd, GWLP_USERDATA, (LONG_PTR)wd);
- mir_snprintf(buff, SIZEOF(buff), "pinggraphwnd%d", wd->item_id);
+ mir_snprintf(buff, "pinggraphwnd%d", wd->item_id);
Utils_RestoreWindowPosition(hGraphWnd, 0, PLUG, buff);
if (!IsWindowVisible(hGraphWnd))
@@ -314,11 +314,11 @@ void graphs_cleanup() {
HWND hwnd;
for (int i = 0; i < list_size; i++) {
- mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", i);
+ mir_snprintf(buff, "WindowHandle%d", i);
if (hwnd = (HWND)db_get_dw(0, PLUG, buff, 0)) {
DestroyWindow(hwnd);
db_set_dw(0, PLUG, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "WindowWasOpen%d", i);
+ mir_snprintf(buff, "WindowWasOpen%d", i);
db_set_b(0, PLUG, buff, 1);
}
}
@@ -330,9 +330,9 @@ void graphs_init() {
char buff[64];
CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
- mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", i->item_id); // clean up from possible crash
+ mir_snprintf(buff, "WindowHandle%d", i->item_id); // clean up from possible crash
db_set_dw(0, PLUG, buff, 0);
- mir_snprintf(buff, SIZEOF(buff), "WindowWasOpen%d", i->item_id); // restore windows that were open on shutdown
+ mir_snprintf(buff, "WindowWasOpen%d", i->item_id); // restore windows that were open on shutdown
if (db_get_b(0, PLUG, buff, 0)) {
db_set_b(0, PLUG, buff, 0);
ShowGraph((WPARAM)i->item_id, (LPARAM)i->pszLabel);
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp
index e3a0e7b6bb..cbd590c503 100644
--- a/plugins/Ping/src/pinglist.cpp
+++ b/plugins/Ping/src/pinglist.cpp
@@ -55,7 +55,7 @@ INT_PTR GetListSize(WPARAM, LPARAM)
void write_ping_address(PINGADDRESS &i)
{
char buff[16];
- mir_snprintf(buff, SIZEOF(buff), "PING_DEST_%d", i.index);
+ mir_snprintf(buff, "PING_DEST_%d", i.index);
if (i.item_id == 0) {
i.item_id = NextID++;
@@ -97,7 +97,7 @@ void write_ping_addresses()
do {
found = false;
- mir_snprintf(buff, SIZEOF(buff), "PING_DEST_%d", index++);
+ mir_snprintf(buff, "PING_DEST_%d", index++);
if (db_get_dw(0, buff, "Id", 0) != 0) {
found = true;
db_set_dw(0, buff, "Id", 0);
@@ -109,7 +109,7 @@ bool read_ping_address(PINGADDRESS &pa) {
int index = pa.index;
char buff[16];
- mir_snprintf(buff, SIZEOF(buff), "PING_DEST_%d", index);
+ mir_snprintf(buff, "PING_DEST_%d", index);
// return if not more contacts, or only deleted contacts remaining
if ((pa.item_id = db_get_dw(0, buff, "Id", 0)) == 0) return false;
diff --git a/plugins/Ping/src/rawping.cpp b/plugins/Ping/src/rawping.cpp
index 98cdace9bd..aad13b220e 100644
--- a/plugins/Ping/src/rawping.cpp
+++ b/plugins/Ping/src/rawping.cpp
@@ -198,7 +198,7 @@ extern int raw_ping(char *host, int timeout)
if (reply->type == PT_ICMP_SOURCE_QUENCH) {
char buff[1024];
- mir_snprintf(buff, SIZEOF(buff), Translate("Host %s requests that you reduce the amount of traffic you are sending."), host);
+ mir_snprintf(buff, Translate("Host %s requests that you reduce the amount of traffic you are sending."), host);
MessageBoxA(0, buff, Translate(PLUG " Warning"), MB_OK | MB_ICONWARNING);
}
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp
index 84d86718b7..f61f0f9399 100644
--- a/plugins/Ping/src/utils.cpp
+++ b/plugins/Ping/src/utils.cpp
@@ -219,7 +219,7 @@ INT_PTR DblClick(WPARAM wParam, LPARAM lParam) {
void import_ping_address(int index, PINGADDRESS &pa) {
DBVARIANT dbv;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "Address%d", index);
+ mir_snprintf(buf, "Address%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
mir_tstrncpy(pa.pszName, dbv.ptszVal, SIZEOF(pa.pszName));
db_free(&dbv);
@@ -227,7 +227,7 @@ void import_ping_address(int index, PINGADDRESS &pa) {
else
mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), SIZEOF(pa.pszName));
- mir_snprintf(buf, SIZEOF(buf), "Label%d", index);
+ mir_snprintf(buf, "Label%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
mir_tstrncpy(pa.pszLabel, dbv.ptszVal, SIZEOF(pa.pszLabel));
db_free(&dbv);
@@ -235,16 +235,16 @@ void import_ping_address(int index, PINGADDRESS &pa) {
else
mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), SIZEOF(pa.pszLabel));
- mir_snprintf(buf, SIZEOF(buf), "Port%d", index);
+ mir_snprintf(buf, "Port%d", index);
pa.port = (int)db_get_dw(0, "PingPlug", buf, -1);
- mir_snprintf(buf, SIZEOF(buf), "Proto%d", index);
+ mir_snprintf(buf, "Proto%d", index);
if (!db_get_s(0, "PingPlug", buf, &dbv)) {
mir_strncpy(pa.pszProto, dbv.pszVal, SIZEOF(pa.pszProto));
db_free(&dbv);
- mir_snprintf(buf, SIZEOF(buf), "Status%d", index);
+ mir_snprintf(buf, "Status%d", index);
pa.set_status = db_get_w(0, "PingPlug", buf, ID_STATUS_ONLINE);
- mir_snprintf(buf, SIZEOF(buf), "Status2%d", index);
+ mir_snprintf(buf, "Status2%d", index);
pa.get_status = db_get_w(0, "PingPlug", buf, ID_STATUS_OFFLINE);
}
else
@@ -259,7 +259,7 @@ void import_ping_address(int index, PINGADDRESS &pa) {
pa.pszParams[0] = '\0';
pa.item_id = 0;
- mir_snprintf(buf, SIZEOF(buf), "Enabled%d", index);
+ mir_snprintf(buf, "Enabled%d", index);
if (db_get_b(0, "PingPlug", buf, 1) == 1)
pa.status = PS_NOTRESPONDING;
else
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp
index 8e869d2349..b7ac68c75c 100644
--- a/plugins/PluginUpdater/src/Notifications.cpp
+++ b/plugins/PluginUpdater/src/Notifications.cpp
@@ -97,7 +97,7 @@ void ShowPopup(LPCTSTR ptszTitle, LPCTSTR ptszText, int Number)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
char setting[100];
- mir_snprintf(setting, SIZEOF(setting), "Popups%d", Number);
+ mir_snprintf(setting, "Popups%d", Number);
if (db_get_b(NULL, MODNAME, setting, DEFAULT_POPUP_ENABLED)) {
POPUPDATAT pd = { 0 };
pd.lchContact = NULL;
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp
index df04c64977..4721a71e40 100644
--- a/plugins/PluginUpdater/src/Options.cpp
+++ b/plugins/PluginUpdater/src/Options.cpp
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
//Popups notified
for (int i = 0; i < POPUPS; i++) {
char str[20] = {0};
- mir_snprintf(str, SIZEOF(str), "Popups%d", i);
+ mir_snprintf(str, "Popups%d", i);
CheckDlgButton(hdlg, (i+40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
}
return TRUE;
@@ -361,11 +361,11 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
for (int i = 0; i < POPUPS; i++) {
ctlColor = SendDlgItemMessage(hdlg, (i+42071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorBack = ctlColor;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iBg", i);
+ mir_snprintf(szSetting, "Popups%iBg", i);
db_set_dw(NULL, MODNAME, szSetting, ctlColor);
ctlColor = SendDlgItemMessage(hdlg, (i+41071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorText = ctlColor;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iTx", i);
+ mir_snprintf(szSetting, "Popups%iTx", i);
db_set_dw(NULL, MODNAME, szSetting, ctlColor);
}
//Colors
@@ -380,7 +380,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
//Notified popups
for (int i = 0; i < POPUPS; i++) {
char str[20] = {0};
- mir_snprintf(str, SIZEOF(str), "Popups%d", i);
+ mir_snprintf(str, "Popups%d", i);
db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
}
return TRUE;
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp
index 1b3ff5583f..264f45d188 100644
--- a/plugins/Popup/src/font.cpp
+++ b/plugins/Popup/src/font.cpp
@@ -131,10 +131,10 @@ void ReloadFonts()
char setting[256];
for (int i = 0; i < gTreeData.getCount(); i++) {
if (gTreeData[i]->typ == 2) {
- mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", gTreeData[i]->pupClass.pszName);
+ mir_snprintf(setting, "%s/TextCol", gTreeData[i]->pupClass.pszName);
gTreeData[i]->colorText = gTreeData[i]->pupClass.colorText =
(COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clText);
- mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", gTreeData[i]->pupClass.pszName);
+ mir_snprintf(setting, "%s/BgCol", gTreeData[i]->pupClass.pszName);
gTreeData[i]->colorBack = gTreeData[i]->pupClass.colorBack =
(COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
}
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index b5a9740f46..3652582256 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -92,32 +92,32 @@ void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
if (ptd->typ == 1) {
char setting[2 * MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}Timeout",
+ mir_snprintf(setting, "{%s/%s}Timeout",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_w(NULL, szModul, setting, ptd->notification.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}enabled",
+ mir_snprintf(setting, "{%s/%s}enabled",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_b(NULL, szModul, setting, ptd->enabled);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}TimeoutVal",
+ mir_snprintf(setting, "{%s/%s}TimeoutVal",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}disableWhen",
+ mir_snprintf(setting, "{%s/%s}disableWhen",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_b(NULL, szModul, setting, ptd->disableWhen);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}leftAction",
+ mir_snprintf(setting, "{%s/%s}leftAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}rightAction",
+ mir_snprintf(setting, "{%s/%s}rightAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
@@ -139,29 +139,29 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
char setting[2 * MAXMODULELABELLENGTH];
char *szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->notification.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, ptd->notification.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
ptd->notification.iSeconds ? ptd->notification.iSeconds : 0);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->disableWhen =
db_get_b(NULL, szModul, setting, 0);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
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);
+ mir_snprintf(setting, "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzRAction);
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -209,7 +209,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
char section[MAXMODULELABELLENGTH], setting[MAXMODULELABELLENGTH];
mir_snprintf(section, SIZEOF(section), "Popups/%s", notification->lpzGroup);
- mir_snprintf(setting, SIZEOF(setting), MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(setting, MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = section;
@@ -259,7 +259,7 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen)
ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), MODULNAME"_%s_%s", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, MODULNAME"_%s_%s", ptd->notification.lpzGroup, ptd->notification.lpzName);
ppd->lchIcon = Skin_GetIcon(setting);
}
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index cb5e2c48f6..35bd585ed0 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -490,25 +490,25 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
char setting[2 * MAXMODULELABELLENGTH];
char *szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
- mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/Timeout", ptd->pupClass.pszName);
ptd->pupClass.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, 0);
- mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/TimeoutVal", ptd->pupClass.pszName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
- mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); // standart ??
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -518,18 +518,18 @@ void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul)
{
char setting[2 * MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName);
db_set_b(NULL, szModul, setting, ptd->enabled);
- mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/Timeout", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->pupClass.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/TimeoutVal", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
}
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 69b06749d8..b77c87a75a 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -377,7 +377,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
LoadClassSettings(ptd, PU_MODULCLASS);
// we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
- mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/TextCol", ptd->pupClass.pszName);
ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
@@ -395,7 +395,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
FontRegisterT(&fid);
// we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
- mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/BgCol", ptd->pupClass.pszName);
ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index c83a430b6b..1a6a14bdf7 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -210,7 +210,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
for (int i = 0; i < 32; ++i) {
char buf[10];
- mir_snprintf(buf, SIZEOF(buf), "opt%d", i);
+ mir_snprintf(buf, "opt%d", i);
wnd->getArgs()->add(buf, (m_flags&(1L << i)) ? 1 : 0);
}
@@ -1042,14 +1042,14 @@ void PopupSkin::freeSkin(SKINELEMENT *head)
void PopupSkin::saveOpts() const
{
char buf[128];
- mir_snprintf(buf, SIZEOF(buf), "skin.%.120S", m_name);
+ mir_snprintf(buf, "skin.%.120S", m_name);
db_set_dw(NULL, MODULNAME, buf, m_flags);
}
void PopupSkin::loadOpts() const
{
char buf[128];
- mir_snprintf(buf, SIZEOF(buf), "skin.%.120S", m_name);
+ mir_snprintf(buf, "skin.%.120S", m_name);
m_flags = db_get_dw(NULL, MODULNAME, buf, m_flags);
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 1bf057c0cd..03f98dd87f 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -361,7 +361,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
{
// See if has to show
char setting[128];
- mir_snprintf(setting, SIZEOF(setting), "ShowOffline%s", pszProto);
+ mir_snprintf(setting, "ShowOffline%s", pszProto);
if (!db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
@@ -383,7 +383,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
continue;
char setting[128];
- mir_snprintf(setting, SIZEOF(setting), "ShowOffline%s", META_PROTO);
+ mir_snprintf(setting, "ShowOffline%s", META_PROTO);
if (db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
}
diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp
index e73e67e49c..daae18a680 100644
--- a/plugins/RecentContacts/src/options.cpp
+++ b/plugins/RecentContacts/src/options.cpp
@@ -14,7 +14,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, (LastUCOpt.HideOffline ? BST_CHECKED : BST_UNCHECKED));
CheckDlgButton(hwndDlg, IDC_WINDOWAUTOSIZE, (LastUCOpt.WindowAutoSize ? BST_CHECKED : BST_UNCHECKED));
- mir_snprintf(str, SIZEOF(str), "%d", LastUCOpt.MaxShownContacts);
+ mir_snprintf(str, "%d", LastUCOpt.MaxShownContacts);
SetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str);
strncpy_s(str, LastUCOpt.DateTimeFormat.c_str(), _TRUNCATE);
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp
index d15119b7f9..b9c5b567b0 100644
--- a/plugins/RemovePersonalSettings/src/rps.cpp
+++ b/plugins/RemovePersonalSettings/src/rps.cpp
@@ -579,7 +579,7 @@ void DeleteFileOrFolder(const char *name)
else if (attibs & FILE_ATTRIBUTE_DIRECTORY) { // Is a directory
// Get all files and delete then
char tmp[MAX_PATH];
- mir_snprintf(tmp, SIZEOF(tmp), "%s\\*.*", name);
+ mir_snprintf(tmp, "%s\\*.*", name);
// Delete files
WIN32_FIND_DATAA findData;
@@ -587,7 +587,7 @@ void DeleteFileOrFolder(const char *name)
if (hwnd != INVALID_HANDLE_VALUE) {
do {
if (mir_strcmp(findData.cFileName, ".") && mir_strcmp(findData.cFileName, "..")) {
- mir_snprintf(tmp, SIZEOF(tmp), "%s\\%s", name, findData.cFileName);
+ mir_snprintf(tmp, "%s\\%s", name, findData.cFileName);
DeleteFileOrFolder(tmp);
}
}
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 4bc091ccdc..14d5606ac9 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -1040,7 +1040,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
char idbuf[128], buf[128];
GetContactUniqueId(dat, idbuf, sizeof(idbuf));
- mir_snprintf(buf, SIZEOF(buf), Translate("User menu - %s"), idbuf);
+ mir_snprintf(buf, Translate("User menu - %s"), idbuf);
SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)buf, 0);
if (cws && !mir_strcmp(cws->szModule, dat->szProto) && !mir_strcmp(cws->szSetting, "Status"))
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 9bf514bd3d..171ebfca17 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -114,7 +114,7 @@ void RegisterFontServiceFonts()
fid.order = i;
char szTemp[100];
- mir_snprintf(szTemp, SIZEOF(szTemp), "SRMFont%d", i);
+ mir_snprintf(szTemp, "SRMFont%d", i);
strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
_tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].defColour;
@@ -166,17 +166,17 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
char str[32];
if (colour) {
- mir_snprintf(str, SIZEOF(str), "%s%dCol", "SRMFont", i);
+ mir_snprintf(str, "%s%dCol", "SRMFont", i);
*colour = db_get_dw(NULL, SRMMMOD, str, fontOptionsList[i].defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "%s%dSize", "SRMFont", i);
+ mir_snprintf(str, "%s%dSize", "SRMFont", i);
lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "%s%dSty", "SRMFont", i);
+ mir_snprintf(str, "%s%dSty", "SRMFont", i);
int style = db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defStyle);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
@@ -186,7 +186,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "%s%d", "SRMFont", i);
+ mir_snprintf(str, "%s%d", "SRMFont", i);
ptrT tszFace(db_get_tsa(NULL, SRMMMOD, str));
if (tszFace == NULL)
@@ -194,7 +194,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
else
_tcsncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName));
- mir_snprintf(str, SIZEOF(str), "%s%dSet", "SRMFont", i);
+ mir_snprintf(str, "%s%dSet", "SRMFont", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
}
}
@@ -407,9 +407,9 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar
SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_SETPOS, TRUE, db_get_dw(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA));
SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_SETRANGE, FALSE, MAKELONG(0,255));
SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_SETPOS, TRUE, db_get_dw(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SRMSGDEFSET_INACTIVEALPHA));
- mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255));
+ mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255));
SetDlgItemTextA(hwndDlg, IDC_ATRANSPARENCYPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255));
+ mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255));
SetDlgItemTextA(hwndDlg, IDC_ITRANSPARENCYPERC, str);
SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETRANGE, 0, MAKELONG(100, 1));
SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETPOS, 0, db_get_w(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES));
@@ -451,9 +451,9 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar
case WM_HSCROLL:
{
char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256));
+ mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256));
SetDlgItemTextA(hwndDlg, IDC_ATRANSPARENCYPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256));
+ mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256));
SetDlgItemTextA(hwndDlg, IDC_ITRANSPARENCYPERC, str);
MarkChanges(16, hwndDlg);
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index cadba31b28..a3e2b75b60 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -1298,7 +1298,7 @@ void ApplyProtoSettings(HWND hDlg)
pSupPro p = arProto[getListViewProto(hLV, i)];
p->inspecting = ListView_GetCheckState(hLV, i);
char tmp[128];
- mir_snprintf(tmp, SIZEOF(tmp), "%s:%d:%d:%d;", p->name, p->inspecting, p->tsplit_on, p->tsplit_off);
+ mir_snprintf(tmp, "%s:%d:%d:%d;", p->name, p->inspecting, p->tsplit_on, p->tsplit_off);
mir_strcat(szNames, tmp);
p->split_on = p->tsplit_on;
p->split_off = p->tsplit_off;
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp
index 9f59e6d3ba..63e3e2455a 100644
--- a/plugins/SecureIM/src/svcs_rsa.cpp
+++ b/plugins/SecureIM/src/svcs_rsa.cpp
@@ -118,7 +118,7 @@ void __cdecl rsa_notify(HANDLE context, int state)
case -0x60:
{
char buf[1024];
- mir_snprintf(buf, SIZEOF(buf), sim510, -state);
+ mir_snprintf(buf, sim510, -state);
showPopupDCmsg(ptr->hContact, buf);
ShowStatusIconNotify(ptr->hContact);
if (ptr->cntx) deleteRSAcntx(ptr);
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp
index 1c010e02c8..140175b128 100644
--- a/plugins/SeenPlugin/src/options.cpp
+++ b/plugins/SeenPlugin/src/options.cpp
@@ -47,7 +47,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
EnableWindow(GetDlgItem(hdlg, IDC_POPUPSTAMPTEXT), hasPopups);
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
char szSetting[100];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Col_%d", i - ID_STATUS_OFFLINE);
+ mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE);
DWORD sett = db_get_dw(NULL, S_MOD, szSetting, StatusColors15bits[i - ID_STATUS_OFFLINE]);
COLORREF back, text;
@@ -147,7 +147,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
DWORD sett = GetDWordFromColors(back, text);
char szSetting[100];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Col_%d", i - ID_STATUS_OFFLINE);
+ mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE);
if (sett != StatusColors15bits[i - ID_STATUS_OFFLINE])
db_set_dw(NULL, S_MOD, szSetting, sett);
else
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index ce2391d99e..32329e7a99 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -486,7 +486,7 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus)
DBVARIANT dbv;
char szSetting[10];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Col_%d", newStatus - ID_STATUS_OFFLINE);
+ mir_snprintf(szSetting, "Col_%d", newStatus - ID_STATUS_OFFLINE);
DWORD sett = db_get_dw(NULL, S_MOD, szSetting, StatusColors15bits[newStatus - ID_STATUS_OFFLINE]);
POPUPDATAT ppd = { 0 };
@@ -591,7 +591,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam)
{
char str[MAXMODULELABELLENGTH + 9];
- mir_snprintf(str, SIZEOF(str), "OffTime-%s", szProto);
+ mir_snprintf(str, "OffTime-%s", szProto);
DWORD t = db_get_dw(NULL, S_MOD, str, 0);
if (!t)
t = time(NULL);
@@ -672,7 +672,7 @@ static void cleanThread(void *param)
}
char str[MAXMODULELABELLENGTH + 9];
- mir_snprintf(str, SIZEOF(str), "OffTime-%s", infoParam->sProtoName);
+ mir_snprintf(str, "OffTime-%s", infoParam->sProtoName);
db_unset(NULL, S_MOD, str);
}
free(infoParam);
@@ -711,7 +711,7 @@ int ModeChange(WPARAM wparam, LPARAM lparam)
time_t t;
time(&t);
- mir_snprintf(str, SIZEOF(str), "OffTime-%s", ack->szModule);
+ mir_snprintf(str, "OffTime-%s", ack->szModule);
db_set_dw(NULL, S_MOD, str, t);
}
}
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 54108687db..7842865d55 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -491,7 +491,7 @@ int SaveSessionDate()
mir_sntprintf(szSessionTime, lenn, _T("%s - %s"), szTimeBuf, szDateBuf);
char szSetting[256];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%d", "SessionDate", 0);
+ mir_snprintf(szSetting, "%s_%d", "SessionDate", 0);
TCHAR *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting);
db_set_ts(NULL, MODNAME, szSetting, szSessionTime);
@@ -516,7 +516,7 @@ int SaveUserSessionName(TCHAR *szUSessionName)
return 1;
char szSetting[256];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%u", "UserSessionDsc", 0);
+ mir_snprintf(szSetting, "%s_%u", "UserSessionDsc", 0);
TCHAR *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting);
if (ptszUserSessionName)
ResaveSettings("UserSessionDsc", 1, 255, ptszUserSessionName);
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp
index d0bb1134ea..9b15bfe40e 100644
--- a/plugins/Sessions/Src/Utils.cpp
+++ b/plugins/Sessions/Src/Utils.cpp
@@ -202,7 +202,7 @@ int GetInSessionOrder(MCONTACT hContact, int mode, int count)
void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int ordernum)
{
char szTemp[3];
- mir_snprintf(szTemp, SIZEOF(szTemp), "%02u", ordernum);
+ mir_snprintf(szTemp, "%02u", ordernum);
if (mode == 0) {
ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsOrder"));
@@ -385,18 +385,18 @@ void SavePosition(HWND hwnd, char *wndName)
RECT rc;
GetWindowRect(hwnd, &rc);
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "%sPosX", wndName);
+ mir_snprintf(buffer, "%sPosX", wndName);
db_set_dw(0, MODNAME, buffer, rc.left);
- mir_snprintf(buffer, SIZEOF(buffer), "%sPosY", wndName);
+ mir_snprintf(buffer, "%sPosY", wndName);
db_set_dw(0, MODNAME, buffer, rc.top);
}
void LoadPosition(HWND hWnd, char *wndName)
{
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "%sPosX", wndName);
+ mir_snprintf(buffer, "%sPosX", wndName);
int x = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2) - 130);
- mir_snprintf(buffer, SIZEOF(buffer), "%sPosY", wndName);
+ mir_snprintf(buffer, "%sPosY", wndName);
int y = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CYSCREEN)) / 2) - 80);
SetWindowPos(hWnd, NULL, x, y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index 488610a156..fcc879976a 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -288,7 +288,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
k2++;
if (k2 == maxk || k2 > maxk) rmark[0] = TRUE;
- mir_snprintf(buff, SIZEOF(buff), "SMsg%d", k);
+ mir_snprintf(buff, "SMsg%d", k);
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal == NULL)
@@ -336,7 +336,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
k2++;
if (k2 == maxk || k2 > maxk) rmark[0] = TRUE;
- mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", k);
+ mir_snprintf(buff, "DefMsg%d", k);
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal == NULL)
@@ -372,7 +372,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
if (szProto)
{
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", szProto);
+ mir_snprintf(szSetting, "Proto%sMaxLen", szProto);
len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
if (len < mir_tstrlen(msg))
{
@@ -407,7 +407,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
char szSetting[80];
TCHAR *format;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : "");
+ mir_snprintf(szSetting, "%sFlags", szProto ? szProto : "");
flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
if (flags & STATUS_EMPTY_MSG)
@@ -416,9 +416,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
if (flags & STATUS_LAST_STATUS_MSG)
{
if (szProto)
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", szProto);
+ mir_snprintf(szSetting, "%sMsg", szProto);
else
- mir_snprintf(szSetting, SIZEOF(szSetting), "Msg");
+ mir_snprintf(szSetting, "Msg");
if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
return NULL; //mir_tstrdup(_T(""));
@@ -429,9 +429,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
else if (flags & STATUS_LAST_MSG)
{
if (szProto)
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", szProto);
+ mir_snprintf(szSetting, "Last%sMsg", szProto);
else
- mir_snprintf(szSetting, SIZEOF(szSetting), "LastMsg");
+ mir_snprintf(szSetting, "LastMsg");
if (db_get(NULL, "SimpleStatusMsg", szSetting, &dbv2))
return NULL; //mir_tstrdup(_T(""));
@@ -449,9 +449,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
else if (flags & STATUS_THIS_MSG)
{
if (szProto)
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sDefault", szProto);
+ mir_snprintf(szSetting, "%sDefault", szProto);
else
- mir_snprintf(szSetting, SIZEOF(szSetting), "Default");
+ mir_snprintf(szSetting, "Default");
if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
return mir_tstrdup(_T(""));
@@ -490,7 +490,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(szSetting, SIZEOF(szSetting), bIsFormat ? "FCur%sMsg" : "Cur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, bIsFormat ? "FCur%sMsg" : "Cur%sMsg", accounts->pa[i]->szModuleName);
DBWriteMessage(szSetting, tszMsg);
#ifdef _DEBUG
if (bIsFormat)
@@ -505,7 +505,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
return;
- mir_snprintf(szSetting, SIZEOF(szSetting), bIsFormat ? "FCur%sMsg" : "Cur%sMsg", szProto);
+ mir_snprintf(szSetting, bIsFormat ? "FCur%sMsg" : "Cur%sMsg", szProto);
DBWriteMessage(szSetting, tszMsg);
#ifdef _DEBUG
if (bIsFormat)
@@ -519,7 +519,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
void SaveStatusAsCurrent(const char *szProto, int iStatus)
{
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto);
+ mir_snprintf(szSetting, "Cur%sStatus", szProto);
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
}
@@ -531,7 +531,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars,
if ((!iStatus || iStatus == ID_STATUS_CURRENT) && szProto)
{
DBVARIANT dbv;
- mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
+ mir_snprintf(szSetting, "FCur%sMsg", szProto);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
@@ -550,7 +550,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars,
if (szProto && !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus)))
return NULL;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto ? szProto : "");
+ mir_snprintf(szSetting, "Proto%sFlags", szProto ? szProto : "");
flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
//if (flags & PROTO_NO_MSG)
@@ -561,7 +561,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars,
if (flags & PROTO_THIS_MSG)
{
DBVARIANT dbv;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto);
+ mir_snprintf(szSetting, "Proto%sDefault", szProto);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
@@ -573,7 +573,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars,
else if (flags & PROTO_NOCHANGE && szProto)
{
DBVARIANT dbv;
- mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
+ mir_snprintf(szSetting, "FCur%sMsg", szProto);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
@@ -654,7 +654,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus
char szSetting[80];
int flags;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto);
+ mir_snprintf(szSetting, "Proto%sFlags", szProto);
flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (flags & PROTO_NO_MSG)
@@ -669,7 +669,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus
DBVARIANT dbv;
TCHAR *msg;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto);
+ mir_snprintf(szSetting, "Proto%sDefault", szProto);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
SaveMessageToDB(szProto, dbv.ptszVal, TRUE);
@@ -806,11 +806,11 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA
{
int iProfileNumber = iStatus - 40083;
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%d_%s", iProfileNumber, accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "%d_%s", iProfileNumber, accounts->pa[i]->szModuleName);
iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
if (iStatus == ID_STATUS_IDLE) // the same as ID_STATUS_LAST in StartupStatus
{
- mir_snprintf(szSetting, SIZEOF(szSetting), "last_%s", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "last_%s", accounts->pa[i]->szModuleName);
iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
}
else if (iStatus == ID_STATUS_CURRENT)
@@ -1021,7 +1021,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
}
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : "");
+ mir_snprintf(szSetting, "%sFlags", szProto ? szProto : "");
int iDlgFlags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
BOOL bShowDlg = iDlgFlags & STATUS_SHOW_DLG || bOnStartup;
@@ -1046,7 +1046,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
return 0;
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto);
+ mir_snprintf(szSetting, "Proto%sFlags", szProto);
iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG) {
if (HasProtoStaticStatusMsg(szProto, iStatus, iStatus))
@@ -1056,7 +1056,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
TCHAR *msg = NULL;
- mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
+ mir_snprintf(szSetting, "FCur%sMsg", szProto);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
msg = mir_tstrdup(dbv.ptszVal);
@@ -1126,7 +1126,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
if (iProtoFlags & PROTO_NOCHANGE) {
DBVARIANT dbv;
- mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
msg = mir_tstrdup(dbv.ptszVal);
@@ -1204,7 +1204,7 @@ int SetStartupStatus(int i)
return -1;
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Proto%sFlags", accounts->pa[i]->szModuleName);
flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (flags & PROTO_NO_MSG || flags & PROTO_THIS_MSG)
{
@@ -1214,7 +1214,7 @@ int SetStartupStatus(int i)
else if (flags & PROTO_NOCHANGE)
{
DBVARIANT dbv;
- mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
fmsg = mir_tstrdup(dbv.ptszVal);
@@ -1481,7 +1481,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam)
continue;
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Proto%sFlags", pa[i]->szModuleName);
int iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG)
continue;
@@ -1601,13 +1601,13 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam)
max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (j = 1; j <= max_hist_msgs; j++)
{
- mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j);
+ mir_snprintf(buff, "SMsg%d", j);
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (!mir_tstrcmp(dbv.ptszVal, szMsgW))
{
found = TRUE;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName);
+ mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName);
db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
db_free(&dbv);
break;
@@ -1618,12 +1618,12 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam)
if (!found)
{
- mir_snprintf(buff, SIZEOF(buff), "FCur%sMsg", ps[i]->szName);
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName);
+ mir_snprintf(buff, "FCur%sMsg", ps[i]->szName);
+ mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName);
db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", ps[i]->szName);
+ mir_snprintf(szSetting, "%sMsg", ps[i]->szName);
db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW);
msg = InsertVarsIntoMsg(szMsgW, ps[i]->szName, status_mode, NULL);
@@ -1823,7 +1823,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
continue;
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Set%sStatusDelay", accounts->pa[i]->szModuleName);
g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), SetStartupStatusProc);
}
}
@@ -1844,7 +1844,7 @@ static int OnOkToExit(WPARAM, LPARAM)
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Last%sStatus", accounts->pa[i]->szModuleName);
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
}
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index 3ce328a87a..3faaa205aa 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -238,7 +238,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
// history messages
if (j < 1)
j = data->max_hist_msgs;
- mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j);
+ mir_snprintf(buff, "SMsg%d", j);
j--;
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) {
if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0') {
@@ -332,7 +332,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
for (i = 1; i <= data->num_def_msgs; ++i) {
// predefined messages
- mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i);
+ mir_snprintf(buff, "DefMsg%d", i);
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) {
if (dbv.ptszVal) {
if (!mir_tstrlen(dbv.ptszVal)) {
@@ -500,7 +500,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
switch (uMsg) {
case WM_CONTEXTMENU:
{
- POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
RECT rc;
GetClientRect(hwndDlg, &rc);
@@ -709,14 +709,14 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
num_start = SendMessage(data->recent_cbex, CB_GETCOUNT, 0, 0);
num_start -= data->num_def_msgs + 1;
- mir_snprintf(setting, SIZEOF(setting), "%sFlags", data->m_szProto ? data->m_szProto : "");
+ mir_snprintf(setting, "%sFlags", data->m_szProto ? data->m_szProto : "");
flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, setting), STATUS_DEFAULT);
if (flags & STATUS_LAST_MSG) {
if (data->m_szProto)
- mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", data->m_szProto);
+ mir_snprintf(setting, "Last%sMsg", data->m_szProto);
else
- mir_snprintf(setting, SIZEOF(setting), "LastMsg");
+ mir_snprintf(setting, "LastMsg");
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) {
if (dbv.pszVal && mir_strlen(dbv.pszVal)) {
@@ -744,9 +744,9 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
}
else if (flags & STATUS_THIS_MSG) {
if (data->m_szProto)
- mir_snprintf(setting, SIZEOF(setting), "%sDefault", data->m_szProto);
+ mir_snprintf(setting, "%sDefault", data->m_szProto);
else
- mir_snprintf(setting, SIZEOF(setting), "Default");
+ mir_snprintf(setting, "Default");
if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv)) {
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal);
@@ -758,9 +758,9 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
}
else if (flags & STATUS_LAST_STATUS_MSG) {
if (data->m_szProto)
- mir_snprintf(setting, SIZEOF(setting), "%sMsg", data->m_szProto);
+ mir_snprintf(setting, "%sMsg", data->m_szProto);
else
- mir_snprintf(setting, SIZEOF(setting), "Msg");
+ mir_snprintf(setting, "Msg");
if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv)) {
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal);
@@ -1129,10 +1129,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (iMsgLen == 0) {
char szSetting[80];
if (msgbox_data->m_szProto) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", msgbox_data->m_szProto);
+ mir_snprintf(szSetting, "Last%sMsg", msgbox_data->m_szProto);
db_set_s(NULL, "SimpleStatusMsg", szSetting, "");
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", msgbox_data->m_szProto);
+ mir_snprintf(szSetting, "%sMsg", msgbox_data->m_szProto);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), _T(""));
}
else {
@@ -1150,10 +1150,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", accounts->pa[j]->szModuleName);
+ mir_snprintf(szSetting, "Last%sMsg", accounts->pa[j]->szModuleName);
db_set_s(NULL, "SimpleStatusMsg", szSetting, "");
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", accounts->pa[j]->szModuleName);
+ mir_snprintf(szSetting, "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), _T(""));
}
@@ -1174,7 +1174,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
BOOL found = FALSE;
for (int i = 1; i <= msgbox_data->max_hist_msgs; i++) {
- mir_snprintf(buff, SIZEOF(buff), "SMsg%d", i);
+ mir_snprintf(buff, "SMsg%d", i);
if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) {
if (!mir_tstrcmp(dbv.ptszVal, tszMsg)) {
found = TRUE;
@@ -1223,7 +1223,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
else
last_modified_msg++;
- mir_snprintf(buff, SIZEOF(buff), "SMsg%d", last_modified_msg);
+ mir_snprintf(buff, "SMsg%d", last_modified_msg);
db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg);
if (msgbox_data->m_szProto) {
@@ -1387,7 +1387,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (LOWORD(histitem.lParam) == HISTORY_MSG) {
char szSetting[16];
- mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", (int)HIWORD(histitem.lParam));
+ mir_snprintf(szSetting, "SMsg%d", (int)HIWORD(histitem.lParam));
db_set_ts(NULL, "SimpleStatusMsg", szSetting, _T(""));
SendMessage(msgbox_data->recent_cbex, CBEM_DELETEITEM, (WPARAM)msgbox_data->curr_sel_msg, 0);
}
@@ -1505,7 +1505,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
SendMessage(msgbox_data->recent_cbex, CBEM_GETITEM, 0, (LPARAM)&histitem);
if (LOWORD(histitem.lParam) == HISTORY_MSG) {
- mir_snprintf(buff, SIZEOF(buff), "SMsg%d", (int)HIWORD(histitem.lParam));
+ mir_snprintf(buff, "SMsg%d", (int)HIWORD(histitem.lParam));
db_set_ts(NULL, "SimpleStatusMsg", buff, _T(""));
}
else if (LOWORD(histitem.lParam) == PREDEFINED_MSG)
@@ -1597,7 +1597,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
cbitem.pszText = text;
SendMessage(msgbox_data->recent_cbex, CBEM_GETITEM, 0, (LPARAM)&cbitem);
- mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i);
+ mir_snprintf(buff, "DefMsg%d", i);
if (LOWORD(cbitem.lParam) == PREDEFINED_MSG) {
new_num_def_msgs++;
db_set_ts(NULL, "SimpleStatusMsg", buff, text);
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp
index 99ca669461..0c19914ee0 100644
--- a/plugins/SimpleStatusMsg/src/options.cpp
+++ b/plugins/SimpleStatusMsg/src/options.cpp
@@ -146,10 +146,10 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (!IsAccountEnabled(accounts->pa[j]) || !CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(setting, SIZEOF(setting), "%sFlags", accounts->pa[j]->szModuleName);
+ mir_snprintf(setting, "%sFlags", accounts->pa[j]->szModuleName);
val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
- mir_snprintf(setting, SIZEOF(setting), "%sDefault", accounts->pa[j]->szModuleName);
+ mir_snprintf(setting, "%sDefault", accounts->pa[j]->szModuleName);
text = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, setting));
mir_tstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
}
@@ -202,14 +202,14 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
// SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, index, (LPARAM)i + 1);
if (index != CB_ERR && index != CB_ERRSPACE)
{
- mir_snprintf(setting, SIZEOF(setting), "Proto%sDefault", accounts->pa[i]->szModuleName);
+ mir_snprintf(setting, "Proto%sDefault", accounts->pa[i]->szModuleName);
data->proto_msg[i+1].msg = db_get_tsa(NULL, "SimpleStatusMsg", setting);
- mir_snprintf(setting, SIZEOF(setting), "Proto%sFlags", accounts->pa[i]->szModuleName);
+ mir_snprintf(setting, "Proto%sFlags", accounts->pa[i]->szModuleName);
val = db_get_b(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT);
data->proto_msg[i+1].flags = val;
- mir_snprintf(setting, SIZEOF(setting), "Proto%sMaxLen", accounts->pa[i]->szModuleName);
+ mir_snprintf(setting, "Proto%sMaxLen", accounts->pa[i]->szModuleName);
val = db_get_w(NULL, "SimpleStatusMsg", setting, 1024);
data->proto_msg[i+1].max_length = val;
SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i + 1);
@@ -442,9 +442,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv, dbv2;
if (i)
- mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[k]->szModuleName);
+ mir_snprintf(setting, "Last%sMsg", accounts->pa[k]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "LastMsg");
+ mir_snprintf(setting, "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
@@ -486,9 +486,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv;
if (i)
- mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[k]->szModuleName);
+ mir_snprintf(setting, "%sMsg", accounts->pa[k]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "Msg");
+ mir_snprintf(setting, "Msg");
if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
{
@@ -597,9 +597,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv, dbv2;
if (i)
- mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[i-1]->szModuleName);
+ mir_snprintf(setting, "Last%sMsg", accounts->pa[i-1]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "LastMsg");
+ mir_snprintf(setting, "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
@@ -640,9 +640,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv;
if (i)
- mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[i-1]->szModuleName);
+ mir_snprintf(setting, "%sMsg", accounts->pa[i-1]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "Msg");
+ mir_snprintf(setting, "Msg");
if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
{
@@ -697,9 +697,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv,dbv2;
if (j)
- mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[j-1]->szModuleName);
+ mir_snprintf(setting, "Last%sMsg", accounts->pa[j-1]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "LastMsg");
+ mir_snprintf(setting, "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
@@ -732,9 +732,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv;
if (j)
- mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[j-1]->szModuleName);
+ mir_snprintf(setting, "%sMsg", accounts->pa[j-1]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "Msg");
+ mir_snprintf(setting, "Msg");
if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting), &dbv))
{
@@ -811,9 +811,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv, dbv2;
if (j)
- mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[j-1]->szModuleName);
+ mir_snprintf(setting, "Last%sMsg", accounts->pa[j-1]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "LastMsg");
+ mir_snprintf(setting, "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
@@ -846,9 +846,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
DBVARIANT dbv;
if (j)
- mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[j-1]->szModuleName);
+ mir_snprintf(setting, "%sMsg", accounts->pa[j-1]->szModuleName);
else
- mir_snprintf(setting, SIZEOF(setting), "Msg");
+ mir_snprintf(setting, "Msg");
if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i+ID_STATUS_ONLINE, setting), &dbv))
{
@@ -1028,10 +1028,10 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(i))
{
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sDefault", accounts->pa[j]->szModuleName);
+ mir_snprintf(szSetting, "%sDefault", accounts->pa[j]->szModuleName);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", accounts->pa[j]->szModuleName);
+ mir_snprintf(szSetting, "%sFlags", accounts->pa[j]->szModuleName);
db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
}
}
@@ -1055,16 +1055,16 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Proto%sDefault", accounts->pa[i]->szModuleName);
if (data->proto_msg[i+1].msg && (data->proto_msg[i+1].flags & PROTO_THIS_MSG))
db_set_ts(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
// else
// db_unset(NULL, "SimpleStatusMsg", szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Proto%sMaxLen", accounts->pa[i]->szModuleName);
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->proto_msg[i+1].max_length);
- mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Proto%sFlags", accounts->pa[i]->szModuleName);
db_set_b(NULL, "SimpleStatusMsg", szSetting, (BYTE)data->proto_msg[i+1].flags);
}
}
@@ -1197,7 +1197,7 @@ static BOOL IsHistoryMsgsFound(HWND hwndDlg, int histMax)
for (int i = 1; i <= histMax; ++i, --j) {
if (j < 1)
j = histMax;
- mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", j);
+ mir_snprintf(szSetting, "SMsg%d", j);
if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) {
if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0') {
db_free(&dbv);
@@ -1360,7 +1360,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(setting, "Last%sMsg", accounts->pa[i]->szModuleName);
db_set_s(NULL, "SimpleStatusMsg", setting, "");
}
db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)max_hist_msgs);
@@ -1379,7 +1379,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
nDefMSgCount = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
for (int i = 1; i <= nDefMSgCount; i++) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "DefMsg%d", i);
+ mir_snprintf(szSetting, "DefMsg%d", i);
db_unset(NULL, "SimpleStatusMsg", szSetting);
}
db_set_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
@@ -1458,9 +1458,9 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
if (index != LB_ERR && index != LB_ERRSPACE)
{
char setting[80];
- mir_snprintf(setting, SIZEOF(setting), "Startup%sStatus", accounts->pa[i]->szModuleName);
+ mir_snprintf(setting, "Startup%sStatus", accounts->pa[i]->szModuleName);
data->status[i] = db_get_w(NULL, "SimpleStatusMsg", setting, ID_STATUS_CURRENT);
- mir_snprintf(setting, SIZEOF(setting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
+ mir_snprintf(setting, "Set%sStatusDelay", accounts->pa[i]->szModuleName);
data->setdelay[i] = db_get_w(NULL, "SimpleStatusMsg", setting, 300);
SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
}
@@ -1640,10 +1640,10 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Startup%sStatus", accounts->pa[i]->szModuleName);
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->status[i]);
- mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
+ mir_snprintf(szSetting, "Set%sStatusDelay", accounts->pa[i]->szModuleName);
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->setdelay[i]);
}
db_set_w(NULL, "SimpleStatusMsg", "SetStatusDelay", (WORD)data->setglobaldelay);
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp
index b77b652757..2d1b04e920 100644
--- a/plugins/SimpleStatusMsg/src/utils.cpp
+++ b/plugins/SimpleStatusMsg/src/utils.cpp
@@ -126,7 +126,7 @@ const char *StatusModeToDbSetting(int status, const char *suffix)
case ID_STATUS_IDLE: prefix = "Idl"; break;
default: return NULL;
}
- mir_snprintf(str, SIZEOF(str), "%s%s", prefix, suffix);
+ mir_snprintf(str, "%s%s", prefix, suffix);
return str;
}
@@ -134,7 +134,7 @@ int GetCurrentStatus(const char *szProto)
{
if (szProto) {
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto);
+ mir_snprintf(szSetting, "Cur%sStatus", szProto);
return (int)db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
}
@@ -147,11 +147,11 @@ int GetStartupStatus(const char *szProto)
int status_mode;
char szSetting[80];
- mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", szProto);
+ mir_snprintf(szSetting, "Startup%sStatus", szProto);
status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_CURRENT);
if (status_mode == ID_STATUS_CURRENT) {
// load status used for this proto last time
- mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", szProto);
+ mir_snprintf(szSetting, "Last%sStatus", szProto);
status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
}
return status_mode;
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 559e0baa6a..67b39b5945 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -190,7 +190,7 @@ void SmileyType::CallSmileyService(MCONTACT hContact)
proto = (const char*)GetContactProto(hContact);
if (proto == NULL) return;
}
- mir_snprintf(str, SIZEOF(str), "%s%s", proto, T2A_SM(name.c_str()));
+ mir_snprintf(str, "%s%s", proto, T2A_SM(name.c_str()));
CallService(str,
ConvertServiceParam(hContact, par1.c_str()),
ConvertServiceParam(hContact, par2.c_str()));
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
index c96098bc38..08a79a64d9 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
@@ -141,13 +141,13 @@ void LoadOptions(TAAAProtoSettingList &loadSettings, BOOL override)
int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName)
{
char setting[128];
- mir_snprintf(setting, SIZEOF(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, "%s_OptionFlags", protoName);
autoAwaySetting.optionFlags = db_get_w(NULL, MODULENAME, setting, FLAG_LV2ONINACTIVE | FLAG_RESET);
- mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, "%s_AwayTime", protoName);
autoAwaySetting.awayTime = db_get_w(NULL, MODULENAME, setting, SETTING_AWAYTIME_DEFAULT);
- mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, "%s_NATime", protoName);
autoAwaySetting.naTime = db_get_w(NULL, MODULENAME, setting, SETTING_NATIME_DEFAULT);
- mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, "%s_StatusFlags", protoName);
autoAwaySetting.statusFlags = db_get_w(NULL, MODULENAME, setting, StatusModeToProtoFlag(ID_STATUS_ONLINE) | StatusModeToProtoFlag(ID_STATUS_FREECHAT));
int flags;
@@ -155,9 +155,9 @@ int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName)
flags = 0xFFFFFF;
else
flags = CallProtoService(protoName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, "%s_Lv1Status", protoName);
autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY)) ? ID_STATUS_AWAY : ID_STATUS_OFFLINE);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, "%s_Lv2Status", protoName);
autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA)) ? ID_STATUS_NA : ID_STATUS_OFFLINE);
return 0;
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
index cdc9c8e603..04be013089 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
@@ -34,17 +34,17 @@ static BOOL bSettingSame = FALSE;
static int WriteAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName)
{
char setting[128];
- mir_snprintf(setting, SIZEOF(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, "%s_OptionFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.optionFlags);
- mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, "%s_AwayTime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.awayTime);
- mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, "%s_NATime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.naTime);
- mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, "%s_StatusFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.statusFlags);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, "%s_Lv1Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv1Status);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, "%s_Lv2Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv2Status);
return 0;
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp
index 06de929df4..64d1a63444 100644
--- a/plugins/StatusPlugins/StartupStatus/options.cpp
+++ b/plugins/StatusPlugins/StartupStatus/options.cpp
@@ -812,7 +812,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
char setting[128];
int i, oldCount = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0);
for (i=0; i < oldCount; i++) {
- mir_snprintf(setting, SIZEOF(setting), "%d_", i);
+ mir_snprintf(setting, "%d_", i);
ClearDatabase(setting);
}
for (i=0; i < arProfiles.getCount(); i++) {
@@ -828,7 +828,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
TSettingsList& ar = *po.ps;
for (int j=0; j < ar.getCount(); j++) {
if ( ar[j].szMsg != NULL ) {
- mir_snprintf(setting, SIZEOF(setting), "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
+ mir_snprintf(setting, "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
db_set_ts(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg);
}
db_set_w(NULL, MODULENAME, OptName(i, ar[j].szName), ar[j].status);
@@ -955,6 +955,6 @@ static int DeleteSetting(const char *szSetting,LPARAM lParam)
char* OptName(int i, const char* setting)
{
static char buf[100];
- mir_snprintf(buf, SIZEOF(buf), "%d_%s", i, setting);
+ mir_snprintf(buf, "%d_%s", i, setting);
return buf;
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index 3a7421957f..25c0e0bffd 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -161,7 +161,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
char setting[80];
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, SETTING_PROFILENAME);
+ mir_snprintf(setting, "%d_%s", profile, SETTING_PROFILENAME);
if ( db_get_ts(NULL, MODULENAME, setting, &dbv))
return -1;
@@ -264,7 +264,7 @@ INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam)
profile = (profile >= 0)?profile:db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0);
char setting[64];
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG);
+ mir_snprintf(setting, "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG);
if (!db_get_b(NULL, MODULENAME, setting, 0))
CallService(MS_CS_SETSTATUSEX,(WPARAM)&profileSettings, 0);
else
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
index aa2bba706e..b126018a9a 100644
--- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
+++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
@@ -47,14 +47,14 @@ TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa)
// load status
char setting[80];
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, pa->szModuleName);
+ mir_snprintf(setting, "%d_%s", profile, pa->szModuleName);
int iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
status = iStatus;
// load last status
- mir_snprintf(setting, SIZEOF(setting), "%s%s", PREFIX_LAST, szName);
+ mir_snprintf(setting, "%s%s", PREFIX_LAST, szName);
iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp
index 70d702f215..6fc5b99823 100644
--- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp
+++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp
@@ -55,12 +55,12 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam)
ttb.pszService = MS_SS_LOADANDSETPROFILE;
for (int i=0; i < profileCount; i++) {
char setting[80];
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
+ mir_snprintf(setting, "%d_%s", i, SETTING_CREATETTBBUTTON);
if (!db_get_b(NULL, MODULENAME, setting, FALSE))
continue;
DBVARIANT dbv;
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", i, SETTING_PROFILENAME);
+ mir_snprintf(setting, "%d_%s", i, SETTING_PROFILENAME);
if (db_get(NULL, MODULENAME, setting, &dbv))
continue;
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp
index 3feff7a963..543bbc0f20 100644
--- a/plugins/StatusPlugins/confirmdialog.cpp
+++ b/plugins/StatusPlugins/confirmdialog.cpp
@@ -69,7 +69,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
{
TCHAR desc[512];
- mir_sntprintf(desc, SIZEOF(desc), TranslateT("Set %s message for %s."),
+ mir_sntprintf(desc, TranslateT("Set %s message for %s."),
pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName);
SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc);
}
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 4c28234aa7..c8754ccab7 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -187,17 +187,17 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
}
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = M.GetDword(szMod, str, fol[j].defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)M.GetByte(szMod, str, fol[j].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
+ mir_snprintf(str, "Font%dSty", i);
style = M.GetByte(szMod, str, fol[j].defStyle);
if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M.GetByte("inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
@@ -211,13 +211,13 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = style & FONTF_STRIKEOUT ? 1 : 0;
}
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = M.GetByte(szMod, str, fol[j].defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%d", i);
+ mir_snprintf(str, "Font%d", i);
if ((i == 17 && !mir_strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !mir_strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
_tcsncpy_s(lf->lfFaceName, _T("Webdings"), _TRUNCATE);
@@ -349,7 +349,7 @@ void Chat_AddIcons(void)
HICON LoadIconEx(char *pszIcoLibName)
{
char szTemp[256];
- mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp);
}
@@ -499,7 +499,7 @@ void RegisterFontServiceFonts()
for (int i = 0; i < SIZEOF(IM_fontOptionsList); i++) {
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
LoadMsgDlgFont(FONTSECTION_IM, i, &lf, &fontOptionsList[i].colour, FONTMODULE);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i);
+ mir_snprintf(szTemp, "Font%d", i);
strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
fid.order = i;
_tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
@@ -562,7 +562,7 @@ void RegisterFontServiceFonts()
_tcsncpy(fid.backgroundName, LPGENT("Fields background"), SIZEOF(fid.backgroundName));
for (int i = 0; i < IPFONTCOUNT; i++) {
LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i + 100);
+ mir_snprintf(szTemp, "Font%d", i + 100);
strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
fid.order = i + 100;
_tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
@@ -584,7 +584,7 @@ void RegisterFontServiceFonts()
_tcsncpy(cid.group, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), SIZEOF(cid.group));
strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup));
for (int i = 0; i <= 7; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
+ mir_snprintf(szTemp, "NickColor%d", i);
_tcsncpy(cid.name, chatcolorsnames[i], SIZEOF(cid.name));
cid.order = i + 1;
strncpy(cid.setting, szTemp, SIZEOF(cid.setting));
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 61e9997c1c..87452fb702 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -2086,17 +2086,17 @@ void TSAPI DeleteContainer(int iIndex)
}
char szSetting[CONTAINER_NAMELEN + 30];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%d_Flags", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%d_Flags", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%d_Trans", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%d_Trans", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dwidth", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dwidth", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dheight", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dheight", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dx", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dx", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dy", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dy", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 5846f432d1..96159f7743 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1622,7 +1622,7 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer)
for (int i = 1; i <= 5; i++) {
char szTemp[40];
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i);
+ mir_snprintf(szTemp, "cc%d", i);
COLORREF colour = M.GetDword(szTemp, RGB(224, 224, 224));
if (colour == 0)
colour = RGB(1, 1, 1);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index abf43caaa6..cf6d077f18 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -236,7 +236,7 @@ static int AppendUnicodeToBuffer(CMStringA &str, const TCHAR *line, int mode)
else {
char szTemp[10];
int colindex = GetColorIndex(GetRTFFont(LOWORD(mode) ? (MSGFONTID_MYMSG + (HIWORD(mode) ? 8 : 0)) : (MSGFONTID_YOURMSG + (HIWORD(mode) ? 8 : 0))));
- mir_snprintf(szTemp, SIZEOF(szTemp), "%02d", colindex);
+ mir_snprintf(szTemp, "%02d", colindex);
str.Append(szTemp);
}
str.AppendChar(' ');
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 6a1b1531f1..4a5776ee46 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -192,19 +192,19 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
char *szModule = fontBlocks[n].szModule;
WritePrivateProfileStringA(fontBlocks[n].szBLockname, "Valid", "1", szIniFilename);
for (i = 0; i < fontBlocks[n].iCount; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", firstIndex + i);
+ mir_snprintf(szTemp, "Font%d", firstIndex + i);
mir_snprintf(szAppname, SIZEOF(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
db_free(&dbv);
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dCol", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dCol", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Color", _itoa(M.GetDword(szModule, szTemp, 0), szBuf, 10), szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSty", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSty", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Style", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSize", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSize", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Size", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSet", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSet", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Set", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
}
n++;
@@ -232,7 +232,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
WritePrivateProfileStringA("RTLTemplates", TemplateNames[i], szRTL, szIniFilename);
}
for (i = 0; i < CUSTOM_COLORS; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i + 1);
+ mir_snprintf(szTemp, "cc%d", i + 1);
if (dat == 0)
WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(M.GetDword(szTemp, 0), szBuf, 10), szIniFilename);
else
@@ -275,7 +275,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
continue;
}
for (i = 0; i < fontBlocks[n].iCount; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", firstIndex + i);
+ mir_snprintf(szTemp, "Font%d", firstIndex + i);
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)
@@ -283,19 +283,19 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
db_set_s(NULL, szModule, szTemp, szBuf);
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dCol", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dCol", firstIndex + i);
db_set_dw(0, szModule, szTemp, GetPrivateProfileIntA(szAppname, "Color", GetSysColor(COLOR_WINDOWTEXT), szIniFilename));
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSty", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSty", firstIndex + i);
db_set_b(0, szModule, szTemp, (BYTE)(GetPrivateProfileIntA(szAppname, "Style", 0, szIniFilename)));
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSize", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSize", firstIndex + i);
bSize = (char)GetPrivateProfileIntA(szAppname, "Size", -10, szIniFilename);
if (bSize > 0)
bSize = -MulDiv(bSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
db_set_b(0, szModule, szTemp, bSize);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSet", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSet", firstIndex + i);
charset = GetPrivateProfileIntA(szAppname, "Set", 0, szIniFilename);
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
charset = 0;
@@ -325,7 +325,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
db_set_b(0, SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
for (i = 0; i < CUSTOM_COLORS; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i + 1);
+ mir_snprintf(szTemp, "cc%d", i + 1);
db_set_dw(0, SRMSGMOD_T, szTemp, GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename));
}
for (i = 0; i <= 7; i++) {
@@ -336,7 +336,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
else
defclr = g_Settings.UserListColors[CHAT_STATUS_NORMAL];
g_Settings.nickColors[i] = GetPrivateProfileIntA("Nick Colors", _itoa(i, szTemp, 10), defclr, szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
+ mir_snprintf(szTemp, "NickColor%d", i);
db_set_dw(0, CHAT_MODULE, szTemp, g_Settings.nickColors[i]);
}
}
@@ -347,7 +347,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
ReleaseDC(NULL, hdc);
if (!noAdvanced) {
for (i = 0; i < MSGDLGFONTCOUNT; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i);
+ mir_snprintf(szTemp, "Font%d", i);
LoadLogfontFromINI(i, szTemp, &dat->theme.logFonts[i], &dat->theme.fontColors[i], szIniFilename);
wsprintfA(dat->theme.rtfFonts + (i * RTFCACHELINESIZE), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, dat->theme.logFonts[i].lfWeight >= FW_BOLD ? 1 : 0, dat->theme.logFonts[i].lfItalic, dat->theme.logFonts[i].lfUnderline, 2 * abs(dat->theme.logFonts[i].lfHeight) * 74 / SY); //!!!!!!!!
}
@@ -371,7 +371,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
dat->theme.right_indent = GetPrivateProfileIntA("Message Log", "RightIndent", 0, szIniFilename);
for (i = 0; i < CUSTOM_COLORS; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i + 1);
+ mir_snprintf(szTemp, "cc%d", i + 1);
dat->theme.custom_colors[i] = GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename);
}
}
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index 85ca77b699..64a5543b09 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -95,7 +95,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
char setting[512];
DBVARIANT dbv;
- mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
+ mir_snprintf(setting, "Name%d", index);
ds->swzName[0] = 0;
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
@@ -104,10 +104,10 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
db_free(&dbv);
- mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
+ mir_snprintf(setting, "Type%d", index);
ds->type = (DisplaySubstType)db_get_b(0, MODULE_ITEMS, setting, DVT_PROTODB);
- mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
+ mir_snprintf(setting, "Module%d", index);
ds->szModuleName[0] = 0;
if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
@@ -115,7 +115,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
db_free(&dbv);
}
- mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
+ mir_snprintf(setting, "Setting%d", index);
ds->szSettingName[0] = 0;
if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
@@ -123,12 +123,12 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
db_free(&dbv);
}
- mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
+ mir_snprintf(setting, "TransFuncId%d", index);
ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1);
// a little backward compatibility
if ((DWORD)ds->iTranslateFuncId == (DWORD)-1) {
- mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index);
+ mir_snprintf(setting, "TransFunc%d", index);
ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0);
}
@@ -139,15 +139,15 @@ void SaveDS(DISPLAYSUBST *ds, int index)
{
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
+ mir_snprintf(setting, "Name%d", index);
db_set_ts(0, MODULE_ITEMS, setting, ds->swzName);
- mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
+ mir_snprintf(setting, "Type%d", index);
db_set_b(0, MODULE_ITEMS, setting, (BYTE)ds->type);
- mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
+ mir_snprintf(setting, "Module%d", index);
db_set_s(0, MODULE_ITEMS, setting, ds->szModuleName);
- mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
+ mir_snprintf(setting, "Setting%d", index);
db_set_s(0, MODULE_ITEMS, setting, ds->szSettingName);
- mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
+ mir_snprintf(setting, "TransFuncId%d", index);
db_set_dw(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
}
@@ -156,7 +156,7 @@ bool LoadDI(DISPLAYITEM *di, int index)
char setting[512];
DBVARIANT dbv;
- mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
+ mir_snprintf(setting, "DILabel%d", index);
di->swzLabel[0] = 0;
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
@@ -165,7 +165,7 @@ bool LoadDI(DISPLAYITEM *di, int index)
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
db_free(&dbv);
- mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
+ mir_snprintf(setting, "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
@@ -173,15 +173,15 @@ bool LoadDI(DISPLAYITEM *di, int index)
db_free(&dbv);
}
- mir_snprintf(setting, SIZEOF(setting), "DIType%d", index);
+ mir_snprintf(setting, "DIType%d", index);
di->type = (DisplayItemType)db_get_b(0, MODULE_ITEMS, setting, DIT_ALL);
- mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
+ mir_snprintf(setting, "DILineAbove%d", index);
di->bLineAbove = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
- mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
+ mir_snprintf(setting, "DIValNewline%d", index);
di->bValueNewline = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
- mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
+ mir_snprintf(setting, "DIVisible%d", index);
di->bIsVisible = (db_get_b(0, MODULE_ITEMS, setting, 1) == 1);
- mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
+ mir_snprintf(setting, "DITipperVarsFirst%d", index);
di->bParseTipperVarsFirst = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
return true;
@@ -191,29 +191,29 @@ void SaveDI(DISPLAYITEM *di, int index)
{
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
+ mir_snprintf(setting, "DILabel%d", index);
if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel)) {
char buff[LABEL_LEN];
t2a(di->swzLabel, buff, LABEL_LEN);
db_set_s(0, MODULE_ITEMS, setting, buff);
}
- mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
+ mir_snprintf(setting, "DIValue%d", index);
if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue)) {
char buff[VALUE_LEN];
t2a(di->swzValue, buff, VALUE_LEN);
db_set_s(0, MODULE_ITEMS, setting, buff);
}
- mir_snprintf(setting, SIZEOF(setting), "DIType%d", index);
+ mir_snprintf(setting, "DIType%d", index);
db_set_b(0, MODULE_ITEMS, setting, (BYTE)di->type);
- mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
+ mir_snprintf(setting, "DILineAbove%d", index);
db_set_b(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
- mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
+ mir_snprintf(setting, "DIValNewline%d", index);
db_set_b(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0);
- mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
+ mir_snprintf(setting, "DIVisible%d", index);
db_set_b(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0);
- mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
+ mir_snprintf(setting, "DITipperVarsFirst%d", index);
db_set_b(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
}
@@ -304,15 +304,15 @@ void LoadObsoleteSkinSetting()
DBVARIANT dbv;
for (int i = 0; i < SKIN_ITEMS_COUNT; i++) {
- mir_snprintf(setting, SIZEOF(setting), "SPaintMode%d", i);
+ mir_snprintf(setting, "SPaintMode%d", i);
opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
- mir_snprintf(setting, SIZEOF(setting), "SImgFile%d", i);
+ mir_snprintf(setting, "SImgFile%d", i);
if (!db_get_ts(NULL, MODULE, setting, &dbv)) {
opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
- mir_snprintf(setting, SIZEOF(setting), "SGlyphMargins%d", i);
+ mir_snprintf(setting, "SGlyphMargins%d", i);
DWORD margins = db_get_dw(NULL, MODULE, setting, 0);
opt.margins[i].top = LOBYTE(LOWORD(margins));
opt.margins[i].right = HIBYTE(LOWORD(margins));
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 998694c0e6..789621bfe9 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -814,7 +814,7 @@ TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szV
return NULL;
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
+ mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ts(0, "AdvStatus", szSetting, &dbv)) {
if (mir_tstrlen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
@@ -836,7 +836,7 @@ HICON GetJabberActivityIcon(MCONTACT hContact, char *szProto)
return NULL;
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, "activity", "icon");
+ mir_snprintf(szSetting, "%s/%s/%s", szProto, "activity", "icon");
if (!db_get_s(hContact, "AdvStatus", szSetting, &dbv)) {
hIcon = Skin_GetIcon(dbv.pszVal);
db_free(&dbv);
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp
index 6e2d173092..930925a7a7 100644
--- a/plugins/TopToolBar/src/toolbar.cpp
+++ b/plugins/TopToolBar/src/toolbar.cpp
@@ -151,12 +151,12 @@ static void Icon2button(TTBButton *but, HANDLE &hIcoLib, HICON &hIcon, bool bIsU
hIcoLib = (HANDLE)CallService(MS_SKIN2_ISMANAGEDICON, WPARAM(hSrc), 0);
if (!hIcoLib) {
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "toptoolbar_%s%s", but->name, bIsUp ? (but->hIconDn ? "%s_up" : "%s") : "%s_dn");
+ mir_snprintf(buf, "toptoolbar_%s%s", but->name, bIsUp ? (but->hIconDn ? "%s_up" : "%s") : "%s_dn");
SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = "Toolbar";
sid.pszName = buf;
sid.pszDefaultFile = NULL;
- mir_snprintf(buf, SIZEOF(buf), "%s%s", but->name, bIsUp ? "" : " (pressed)");
+ mir_snprintf(buf, "%s%s", but->name, bIsUp ? "" : " (pressed)");
sid.pszDescription = buf;
sid.hDefaultIcon = bIsUp ? but->hIconUp : but->hIconDn;
hIcoLib = Skin_AddIcon(&sid);
@@ -598,7 +598,7 @@ static int OnModulesLoad(WPARAM, LPARAM)
if (HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange)) {
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", LPGEN("TopToolBar background"), TTB_OPTDIR);
+ mir_snprintf(buf, "%s/%s", LPGEN("TopToolBar background"), TTB_OPTDIR);
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)buf, 0);
}
return 0;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index f5f1e05bee..e968284786 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -292,9 +292,9 @@ void CExImContactBase::toIni(FILE* file, int modCount)
if (_pszProto == NULL || !loaded) {
if (_pszProto){
if (_pszNick)
- mir_snprintf(name, SIZEOF(name),"%s (%s)", _pszNick, _pszProto);
+ mir_snprintf(name,"%s (%s)", _pszNick, _pszProto);
else
- mir_snprintf(name, SIZEOF(name),"(UNKNOWN) (%s)", _pszProto);
+ mir_snprintf(name,"(UNKNOWN) (%s)", _pszProto);
}
else
strncpy_s(name, "(UNKNOWN)", _TRUNCATE);
@@ -316,9 +316,9 @@ void CExImContactBase::toIni(FILE* file, int modCount)
}
LPSTR pszUID = uid2String(FALSE);
if (_pszUIDKey && pszUID)
- mir_snprintf(name, SIZEOF(name), "%s *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID);
+ mir_snprintf(name, "%s *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID);
else
- mir_snprintf(name, SIZEOF(name), "%s (%s)", pszCI, _pszProto);
+ mir_snprintf(name, "%s (%s)", pszCI, _pszProto);
mir_free(pszCI);
mir_free(pszUID);
diff --git a/plugins/UserInfoEx/src/ex_import/tinyxml.cpp b/plugins/UserInfoEx/src/ex_import/tinyxml.cpp
index 27ba54d82a..b41bffa85e 100644
--- a/plugins/UserInfoEx/src/ex_import/tinyxml.cpp
+++ b/plugins/UserInfoEx/src/ex_import/tinyxml.cpp
@@ -110,7 +110,7 @@ void TiXmlBase::PutString(const TIXML_STRING& str, TIXML_STRING* outString)
// Easy pass at non-alpha/numeric/symbol
// Below 32 is symbolic.
char buf[32];
- mir_snprintf(buf, SIZEOF(buf), "&#x%02X;", (unsigned) (c & 0xff));
+ mir_snprintf(buf, "&#x%02X;", (unsigned) (c & 0xff));
//*ME: warning C4267: convert 'size_t' to 'int'
//*ME: Int-Cast to make compiler happy ...
@@ -758,7 +758,7 @@ int TiXmlElement::QueryDoubleAttribute(const char* name, double* dval) const
void TiXmlElement::SetAttribute(const char * name, int val)
{
char buf[64];
- mir_snprintf(buf, SIZEOF(buf), "%d", val);
+ mir_snprintf(buf, "%d", val);
SetAttribute(name, buf);
}
@@ -776,7 +776,7 @@ void TiXmlElement::SetAttribute(const std::string& name, int val)
void TiXmlElement::SetDoubleAttribute(const char * name, double val)
{
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "%f", val);
+ mir_snprintf(buf, "%f", val);
SetAttribute(name, buf);
}
@@ -1422,14 +1422,14 @@ int TiXmlAttribute::QueryDoubleValue(double* dval) const
void TiXmlAttribute::SetIntValue(int _value)
{
char buf[64];
- mir_snprintf(buf, SIZEOF(buf), "%d", _value);
+ mir_snprintf(buf, "%d", _value);
SetValue(buf);
}
void TiXmlAttribute::SetDoubleValue(double _value)
{
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "%lf", _value);
+ mir_snprintf(buf, "%lf", _value);
SetValue(buf);
}
diff --git a/plugins/UserInfoEx/src/svc_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp
index f0faf6faaa..1219e9ec17 100644
--- a/plugins/UserInfoEx/src/svc_contactinfo.cpp
+++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp
@@ -571,7 +571,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam)
int offset = tzi->Bias + tzi->StandardBias;
char str[80];
- mir_snprintf(str, SIZEOF(str), offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
+ mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
ci->pszVal = ci->dwFlag & CNF_UNICODE ? (TCHAR*)mir_a2u(str) : (TCHAR*)mir_strdup(str);
ci->type = CNFT_ASCIIZ;
return 0;
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp
index 22abffcfd3..5338f4695d 100644
--- a/plugins/Variables/src/help.cpp
+++ b/plugins/Variables/src/help.cpp
@@ -322,12 +322,12 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr)
}
if (tr->flags&TRF_FIELD)
- mir_sntprintf(desc, len, _T("%c%s%c"), FIELD_CHAR, tr->szTokenString, FIELD_CHAR);
+ mir_sntprintf(desc, len, _T("%c%s%c"), FIELD_CHAR, tr->szTokenString, FIELD_CHAR);
else {
if (args != NULL)
tArgs = mir_a2t(args);
- mir_sntprintf(desc, len, _T("%c%s%s"), FUNC_CHAR, tr->tszTokenString, (tArgs!=NULL?tArgs:_T("")));
+ mir_sntprintf(desc, len, _T("%c%s%s"), FUNC_CHAR, tr->tszTokenString, (tArgs!=NULL?tArgs:_T("")));
}
mir_free(tArgs);
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp
index e3dac6f51f..864b9a81bd 100644
--- a/plugins/WhenWasIt/src/icons.cpp
+++ b/plugins/WhenWasIt/src/icons.cpp
@@ -60,7 +60,7 @@ int AddIcons()
hDTB[0] = AddIcon("DTB0", LPGEN("Birthday today"), tszPath, IDI_DTB0);
hDTB[1] = AddIcon("DTB1", LPGEN("1 day to birthday"), tszPath, IDI_DTB1);
for (int i = 2; i < cDTB; i++) {
- mir_snprintf(name, SIZEOF(name), "DTB%d", i);
+ mir_snprintf(name, "DTB%d", i);
mir_snprintf(description, SIZEOF(description), Translate("%d days to birthday"), i);
hDTB[i] = AddIcon(name, description, tszPath, IDI_DTB0 + i);
}
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp
index 42bf4be905..f8da4effb5 100644
--- a/plugins/WhenWasIt/src/utils.cpp
+++ b/plugins/WhenWasIt/src/utils.cpp
@@ -80,11 +80,11 @@ char* BinToHex(int size, PBYTE data)
int maxSize = size * 2 + HEX_SIZE + 1;
szresult = (char *) new char[maxSize];
memset(szresult, 0, maxSize);
- mir_snprintf(buffer, SIZEOF(buffer), "%0*X", HEX_SIZE, size);
+ mir_snprintf(buffer, "%0*X", HEX_SIZE, size);
mir_strcpy(szresult, buffer);
for (int i = 0; i < size; i++) {
- mir_snprintf(buffer, SIZEOF(buffer), "%02X", data[i]);
+ mir_snprintf(buffer, "%02X", data[i]);
mir_strcpy(szresult + (HEX_SIZE + i * 2), buffer);
}
return szresult;
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp
index 51fb53124e..3cfe906eec 100644
--- a/plugins/XSoundNotify/src/xsn_main.cpp
+++ b/plugins/XSoundNotify/src/xsn_main.cpp
@@ -89,7 +89,7 @@ static int ProtoAck(WPARAM, LPARAM lParam)
for (int i = 0; i < SIZEOF(selfSounds); i++) {
if (selfSounds[i].iStatus == ack->lParam) {
char buf[128];
- mir_snprintf(buf, SIZEOF(buf), "%s%s", ack->szModule, selfSounds[i].szName);
+ mir_snprintf(buf, "%s%s", ack->szModule, selfSounds[i].szName);
SkinPlaySound(buf);
break;
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index 3f506bfb74..8513616923 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -808,7 +808,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
if (MN->Real.PopupTC + MN->Virtual.PopupTC)
{
char tmp[255];
- mir_snprintf(tmp, SIZEOF(tmp), Translate("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
+ mir_snprintf(tmp, Translate("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
db_set_s(ActualAccount->hContact, "CList", "StatusMsg", tmp);
}
else db_set_s(ActualAccount->hContact, "CList", "StatusMsg", Translate("No new mail message"));
@@ -1599,7 +1599,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (GetWindowLongPtr((HWND)wParam, GWLP_ID) == IDC_LISTHEADERS) {
//MessageBox(0,"LISTHEADERS","Debug",0);
HWND hList = GetDlgItem(hDlg, IDC_LISTHEADERS);
- POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if (pt.x == -1) pt.x = 0;
if (pt.y == -1) pt.y = 0;
if (int numRows = ListView_GetItemCount(hList)) {
@@ -2384,7 +2384,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (GetWindowLongPtr((HWND)wParam, GWLP_ID) == IDC_LISTMAILS) {
//MessageBox(0,"LISTHEADERS","Debug",0);
HWND hList = GetDlgItem(hDlg, IDC_LISTMAILS);
- POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if (pt.x == -1) pt.x = 0;
if (pt.y == -1) pt.y = 0;
if (int numRows = ListView_GetItemCount(hList)) {
diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp
index 7f24b0a5db..221fbc2aaf 100644
--- a/plugins/YAMN/src/proto/netlib.cpp
+++ b/plugins/YAMN/src/proto/netlib.cpp
@@ -36,7 +36,7 @@ HANDLE RegisterNLClient(const char *name)
static NETLIBUSER nlu={0};
char desc[128];
- mir_snprintf(desc, SIZEOF(desc), Translate("%s connection"), name);
+ mir_snprintf(desc, Translate("%s connection"), name);
#ifdef DEBUG_COMM
DebugLog(CommFile,"<Register PROXY support>");
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp
index 5da4abb113..fc3cf8c3f3 100644
--- a/plugins/YAPP/src/options.cpp
+++ b/plugins/YAPP/src/options.cpp
@@ -37,7 +37,7 @@ void LoadOptions()
char buff[128];
for (int i = 0; i < 10; i++) {
- mir_snprintf(buff, SIZEOF(buff), "DisableStatus%d", i - 1); // -1 because i forgot offline status earlier!
+ mir_snprintf(buff, "DisableStatus%d", i - 1); // -1 because i forgot offline status earlier!
options.disable_status[i] = (db_get_b(0, MODULE, buff, 0) == 1);
}
@@ -71,7 +71,7 @@ void SaveOptions()
char buff[128];
for (int i = 0; i < 9; i++) {
- mir_snprintf(buff, SIZEOF(buff), "DisableStatus%d", i - 1);
+ mir_snprintf(buff, "DisableStatus%d", i - 1);
db_set_b(0, MODULE, buff, options.disable_status[i] ? 1 : 0);
}
db_set_b(0, MODULE, "DisableFullScreen", (options.disable_full_screen ? 1 : 0));
@@ -453,11 +453,11 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam
char setting[256];
for (int i = 0; i < arClasses.getCount(); i++) {
POPUPCLASS *pc = arClasses[i];
- mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", pc->pszName);
+ mir_snprintf(setting, "%s/Timeout", pc->pszName);
db_set_w(0, MODULE, setting, pc->iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", pc->pszName);
+ mir_snprintf(setting, "%s/TextCol", pc->pszName);
db_set_dw(0, MODULE, setting, (DWORD)pc->colorText);
- mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", pc->pszName);
+ mir_snprintf(setting, "%s/BgCol", pc->pszName);
db_set_dw(0, MODULE, setting, (DWORD)pc->colorBack);
}
return TRUE;
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index 67261cc058..57691eefe9 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -338,12 +338,12 @@ static INT_PTR RegisterPopupClass(WPARAM wParam, LPARAM lParam)
pc->pszDescription = mir_strdup(pc->pszDescription);
char setting[256];
- mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", pc->pszName);
+ mir_snprintf(setting, "%s/Timeout", pc->pszName);
pc->iSeconds = db_get_w(0, MODULE, setting, pc->iSeconds);
if (pc->iSeconds == (WORD)-1) pc->iSeconds = -1;
- mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", pc->pszName);
+ mir_snprintf(setting, "%s/TextCol", pc->pszName);
pc->colorText = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorText);
- mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", pc->pszName);
+ mir_snprintf(setting, "%s/BgCol", pc->pszName);
pc->colorBack = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorBack);
arClasses.insert(pc);
diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp
index f13cd473ff..fe79736be4 100644
--- a/plugins/YahooGroups/src/services.cpp
+++ b/plugins/YahooGroups/src/services.cpp
@@ -53,7 +53,7 @@ void ReadAvailableGroups()
while (ok)
{
- mir_snprintf(tmp, SIZEOF(tmp), "%d", index);
+ mir_snprintf(tmp, "%d", index);
GetStringFromDatabase(NULL, CLIST_GROUPS, tmp, NULL, group, sizeof(group));
if (mir_strlen(group) > 0)
{
@@ -76,7 +76,7 @@ int GetNextGroupIndex()
while (!found)
{
- mir_snprintf(tmp, SIZEOF(tmp), "%d", index++);
+ mir_snprintf(tmp, "%d", index++);
if (GetStringFromDatabase(NULL, CLIST_GROUPS, tmp, NULL, buffer, sizeof(buffer)))
{
@@ -97,7 +97,7 @@ void AddNewGroup(const char *newGroup)
*group = 1;
strncpy_s((group + 1), (SIZEOF(group) - 1), newGroup, _TRUNCATE);
- mir_snprintf(tmp, SIZEOF(tmp), "%d", index);
+ mir_snprintf(tmp, "%d", index);
const int MAX_SIZE = 1024;
wchar_t wide[MAX_SIZE] = {0};
*wide = 1;
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp
index 5da8431f39..9f6f63d865 100644
--- a/plugins/YahooGroups/src/utils.cpp
+++ b/plugins/YahooGroups/src/utils.cpp
@@ -102,12 +102,12 @@ char *BinToHex(int size, PBYTE data)
int maxSize = size * 2 + HEX_SIZE + 1;
szresult = (char *) new char[ maxSize ];
memset(szresult, 0, maxSize);
- mir_snprintf(buffer, SIZEOF(buffer), "%0*X", HEX_SIZE, size);
+ mir_snprintf(buffer, "%0*X", HEX_SIZE, size);
mir_strcpy(szresult, buffer);
int i;
for (i = 0; i < size; i++)
{
- mir_snprintf(buffer, SIZEOF(buffer), "%02X", data[i]);
+ mir_snprintf(buffer, "%02X", data[i]);
mir_strcpy(szresult + (HEX_SIZE + i * 2), buffer);
}
return szresult;
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp
index da46bbe96b..624a9e9a84 100644
--- a/protocols/FacebookRM/src/events.cpp
+++ b/protocols/FacebookRM/src/events.cpp
@@ -34,14 +34,14 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
case FACEBOOK_EVENT_CLIENT:
if (!getByte(FACEBOOK_KEY_EVENT_CLIENT_ENABLE, DEFAULT_EVENT_CLIENT_ENABLE))
return NULL;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Client");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Client");
flags |= NIIF_WARNING;
break;
case FACEBOOK_EVENT_NEWSFEED:
if (!getByte(FACEBOOK_KEY_EVENT_FEEDS_ENABLE, DEFAULT_EVENT_FEEDS_ENABLE))
return NULL;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Newsfeed");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed");
SkinPlaySound("NewsFeed");
flags |= NIIF_INFO;
break;
@@ -49,7 +49,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
case FACEBOOK_EVENT_NOTIFICATION:
if (!getByte(FACEBOOK_KEY_EVENT_NOTIFICATIONS_ENABLE, DEFAULT_EVENT_NOTIFICATIONS_ENABLE))
return NULL;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
SkinPlaySound("Notification");
flags |= NIIF_INFO;
break;
@@ -57,7 +57,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
case FACEBOOK_EVENT_OTHER:
if (!getByte(FACEBOOK_KEY_EVENT_OTHER_ENABLE, DEFAULT_EVENT_OTHER_ENABLE))
return NULL;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Other");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Other");
SkinPlaySound("OtherEvent");
flags |= NIIF_INFO;
break;
@@ -65,7 +65,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
case FACEBOOK_EVENT_FRIENDSHIP:
if (!getByte(FACEBOOK_KEY_EVENT_FRIENDSHIP_ENABLE, DEFAULT_EVENT_FRIENDSHIP_ENABLE))
return NULL;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Friendship");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship");
SkinPlaySound("Friendship");
flags |= NIIF_INFO;
break;
@@ -73,7 +73,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
case FACEBOOK_EVENT_TICKER:
if (!getByte(FACEBOOK_KEY_EVENT_TICKER_ENABLE, DEFAULT_EVENT_TICKER_ENABLE))
return NULL;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Ticker");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker");
SkinPlaySound("Ticker");
flags |= NIIF_INFO;
break;
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index fee5b2d6f9..968a0c5c99 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -991,8 +991,8 @@ void FacebookProto::InitPopups()
char name[256];
// Client
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Client notifications"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Client");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Client notifications"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Client");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("facebook"));
@@ -1002,8 +1002,8 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Newsfeeds
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("News feeds"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Newsfeed");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("News feeds"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("newsfeed"));
@@ -1013,8 +1013,8 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Notifications
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Notifications"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Notifications"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("notification"));
@@ -1024,8 +1024,8 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Others
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Other events"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Other");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Other events"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Other");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("facebook"));
@@ -1035,8 +1035,8 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Friendship changes
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Friendship events"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Friendship");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Friendship events"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("friendship"));
@@ -1046,8 +1046,8 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Ticker
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Ticker feeds"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Ticker");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Ticker feeds"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("newsfeed"));
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp
index 47d760cf70..833bfeef0a 100644
--- a/protocols/GTalkExt/src/avatar.cpp
+++ b/protocols/GTalkExt/src/avatar.cpp
@@ -45,7 +45,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile)
return NULL;
TCHAR full[MAX_PATH + 2];
- mir_sntprintf(full, SIZEOF(full), AVA_FILE_NAME_FORMAT, path, name);
+ mir_sntprintf(full, AVA_FILE_NAME_FORMAT, path, name);
CreateDirectoryTreeT(full);
HANDLE h = CreateFile(full, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index 16af0a823e..1aa2733414 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -189,7 +189,7 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji)
lastThreadId(ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid));
TCHAR id[30];
- mir_sntprintf(id, SIZEOF(id), JABBER_IQID_FORMAT, uID);
+ mir_sntprintf(id, JABBER_IQID_FORMAT, uID);
xi.addAttr(node, ATTRNAME_ID, id);
child = xi.addChild(node, NODENAME_QUERY, NULL);
@@ -249,7 +249,7 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji)
xi.addAttr(node, ATTRNAME_TO, jid);
TCHAR id[30];
- mir_sntprintf(id, SIZEOF(id), JABBER_IQID_FORMAT, ji->SerialNext());
+ mir_sntprintf(id, JABBER_IQID_FORMAT, ji->SerialNext());
xi.addAttr(node, ATTRNAME_ID, id);
child = xi.addChild(node, NODENAME_USERSETTING, NULL);
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp
index 8db7427a0d..fcafd253b7 100644
--- a/protocols/GTalkExt/src/inbox.cpp
+++ b/protocols/GTalkExt/src/inbox.cpp
@@ -222,8 +222,8 @@ void OpenContactInbox(LPCSTR szModuleName)
TCHAR buf[1024];
if (mir_tstrcmpi(host, COMMON_GMAIL_HOST1) && mir_tstrcmpi(host, COMMON_GMAIL_HOST2))
- mir_sntprintf(buf, SIZEOF(buf), INBOX_URL_FORMAT, _T("a/"), host); // hosted
+ mir_sntprintf(buf, INBOX_URL_FORMAT, _T("a/"), host); // hosted
else
- mir_sntprintf(buf, SIZEOF(buf), INBOX_URL_FORMAT, _T(""), _T("mail")); // common
+ mir_sntprintf(buf, INBOX_URL_FORMAT, _T(""), _T("mail")); // common
OpenUrl(szModuleName, tszJid, buf);
}
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index 9e3bd386e1..e7813894c1 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -254,7 +254,7 @@ void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unread
POPUPDATAT data = { 0 };
FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount);
- mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
+ mir_sntprintf(data.lptzText, TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
ShowNotification(acc, &data, jid, url, unreadCount);
}
@@ -277,9 +277,9 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre
}
if (ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings)))
- mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
+ mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
else
- mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
+ mir_sntprintf(data.lptzText, TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
ShowNotification(acc, &data, jid, url, unreadCount);
}
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp
index 053faf2bba..b15eb53042 100644
--- a/protocols/GTalkExt/src/options.cpp
+++ b/protocols/GTalkExt/src/options.cpp
@@ -157,8 +157,8 @@ INT_PTR CALLBACK AccOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa
void ShowTestPopup(HWND wnd)
{
POPUPDATAT data = { 0 };
- mir_sntprintf(data.lptzContactName, SIZEOF(data.lptzContactName), TranslateTS(TEST_LETTER_INBOX));
- mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
+ mir_sntprintf(data.lptzContactName, TranslateTS(TEST_LETTER_INBOX));
+ mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1;
LPTSTR timeout = (LPTSTR)malloc(len * sizeof(TCHAR));
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index 5e6b7b199a..1d27e336ed 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -61,7 +61,7 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts)
*avatarurl = *avatarts = NULL;
char szUrl[128];
- mir_snprintf(szUrl, SIZEOF(szUrl), "http://api.gadu-gadu.pl/avatars/%d/0.xml", uin);
+ mir_snprintf(szUrl, "http://api.gadu-gadu.pl/avatars/%d/0.xml", uin);
NETLIBHTTPREQUEST req = { sizeof(req) };
req.requestType = REQUEST_GET;
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index 14fc85d6ce..8534d0e5cb 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -338,7 +338,7 @@ int GGPROTO::oauth_receivetoken()
mir_free(str);
str = oauth_uri_escape("http://www.mojageneracja.pl");
- mir_snprintf(szUrl, SIZEOF(szUrl), "callback_url=%s&request_token=%s&uin=%s&password=%s",
+ mir_snprintf(szUrl, "callback_url=%s&request_token=%s&uin=%s&password=%s",
str, token, uin, password);
mir_free(str);
str = mir_strdup(szUrl);
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index 92fa0553df..210024ffc0 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -67,7 +67,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask,
cle.hDbEvent = -100;
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadIconEx(IDI_DCC);
- mir_snprintf(szService, SIZEOF(szService), "%s/DblClickEvent", m_szModuleName);
+ mir_snprintf(szService, "%s/DblClickEvent", m_szModuleName);
cle.pszService = szService;
mir_sntprintf(szNick, SIZEOF(szNick), TranslateT("CTCP chat request from %s"), name.c_str());
cle.ptszTooltip = szNick;
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 9b333a5597..ca3f4aea60 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -1430,18 +1430,18 @@ LBL_Parse:
char buf[1024 * 4];
if (iParamCnt != 2)
- cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : ERROR : UNKNOWN-ERROR\r\n", szBuf);
+ cbLen = mir_snprintf(buf, "%s : ERROR : UNKNOWN-ERROR\r\n", szBuf);
else {
for (int i = 0; i < g_Instances.getCount(); i++) {
if (PeerPortNrRcvd == g_Instances[i]->m_info.iPort && LocalPortNrRcvd == g_Instances[i]->m_myLocalPort) {
- cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : USERID : %S : %S\r\n",
+ cbLen = mir_snprintf(buf, "%s : USERID : %S : %S\r\n",
szBuf, g_Instances[i]->m_info.sIdentServerType.c_str(), g_Instances[i]->m_info.sUserID.c_str());
break;
}
}
if (cbLen == 0)
- cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : ERROR : INVALID-PORT\r\n", szBuf);
+ cbLen = mir_snprintf(buf, "%s : ERROR : INVALID-PORT\r\n", szBuf);
}
if (Netlib_Send(hConnection, (const char*)buf, cbLen, 0) > 0)
diff --git a/protocols/IcqOscarJ/src/editstring.cpp b/protocols/IcqOscarJ/src/editstring.cpp
index f792660d52..2ea8f8eb1c 100644
--- a/protocols/IcqOscarJ/src/editstring.cpp
+++ b/protocols/IcqOscarJ/src/editstring.cpp
@@ -239,7 +239,7 @@ void ChangeInfoData::BeginStringEdit(int iItem, RECT *rc, int i, WORD wVKey)
szValue = " ";
else if ((si.displayType & LIM_TYPE) == LI_NUMBER) {
szValue = str;
- mir_snprintf(str, SIZEOF(str), "%d", sid.value);
+ mir_snprintf(str, "%d", sid.value);
}
else if (sid.value) {
szValue = BinaryToEscapes((char*)sid.value);
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp
index fd917076b1..83e28ffa0f 100644
--- a/protocols/IcqOscarJ/src/fam_13servclist.cpp
+++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp
@@ -1248,7 +1248,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wItem
char *nick = NickFromHandleUtf(hContact);
setByte(hContact, "Auth", 0);
- mir_snprintf(str, SIZEOF(str), ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, SIZEOF(msg)), nick);
+ mir_snprintf(str, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, SIZEOF(msg)), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
}
@@ -1258,7 +1258,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wItem
char *nick = NickFromHandleUtf(hContact);
setByte(hContact, "Auth", 1);
- mir_snprintf(str, SIZEOF(str), ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, SIZEOF(msg)), nick);
+ mir_snprintf(str, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, SIZEOF(msg)), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
}
@@ -1348,7 +1348,7 @@ void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wItem
char msg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- mir_snprintf(str, SIZEOF(str), ICQTranslateUtfStatic(LPGEN("User \"%s\" was removed from server list."), msg, SIZEOF(msg)), nick);
+ mir_snprintf(str, ICQTranslateUtfStatic(LPGEN("User \"%s\" was removed from server list."), msg, SIZEOF(msg)), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
}
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index a469c5ea39..e2a0ca4787 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -705,7 +705,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
char buf[MAX_PATH];
char *format = GetWindowTextUtf(hwndDlg);
- mir_snprintf(str, SIZEOF(str), format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):"");
+ mir_snprintf(str, format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):"");
SetWindowTextUtf(hwndDlg, str);
SAFE_FREE(&format);
}
@@ -743,14 +743,14 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
dat->ppro->setByte(DBSETTING_XSTATUS_ID, dat->bXStatus);
char *szValue = GetDlgItemTextUtf(hwndDlg,IDC_XMSG);
- mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", dat->bXStatus);
+ mir_snprintf(szSetting, "XStatus%dMsg", dat->bXStatus);
db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_MSG, szValue);
SAFE_FREE(&szValue);
if (dat->ppro->m_bXStatusEnabled) {
szValue = GetDlgItemTextUtf(hwndDlg,IDC_XTITLE);
- mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dName", dat->bXStatus);
+ mir_snprintf(szSetting, "XStatus%dName", dat->bXStatus);
db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_NAME, szValue);
SAFE_FREE(&szValue);
@@ -796,13 +796,13 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
char *szName = NULL, *szMsg = NULL;
if (m_bXStatusEnabled) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dName", bXStatus);
+ mir_snprintf(szSetting, "XStatus%dName", bXStatus);
szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus-1], str, MAX_PATH));
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", bXStatus);
+ mir_snprintf(szSetting, "XStatus%dMsg", bXStatus);
szMsg = getSettingStringUtf(NULL, szSetting, "");
- mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dStat", bXStatus);
+ mir_snprintf(szSetting, "XStatus%dStat", bXStatus);
if (!bQuiet && !getByte(szSetting, 0)) {
InitXStatusData init;
init.ppro = this;
@@ -897,7 +897,7 @@ void InitXStatusIcons()
for (int i = 0; i < XSTATUS_COUNT; i++) {
char szTemp[100];
- mir_snprintf(szTemp, SIZEOF(szTemp), "icq_xstatus%d", i);
+ mir_snprintf(szTemp, "icq_xstatus%d", i);
sid.pszName = szTemp;
sid.pszDescription = (LPSTR)nameXStatus[i];
sid.iDefaultIndex = -(IDI_XSTATUS1+i);
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp
index c8439eeb6c..cd3b3297de 100644
--- a/protocols/IcqOscarJ/src/log.cpp
+++ b/protocols/IcqOscarJ/src/log.cpp
@@ -144,6 +144,6 @@ void CIcqProto::icq_LogFatalParam(const char *szMsg, WORD wError)
char str[MAX_PATH];
char buf[MAX_PATH];
- mir_snprintf(buf, SIZEOF(buf), ICQTranslateUtfStatic(szMsg, str, SIZEOF(str)), wError);
+ mir_snprintf(buf, ICQTranslateUtfStatic(szMsg, str, SIZEOF(str)), wError);
icq_LogMessage(LOG_FATAL, buf);
}
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp
index af56e712b3..00dd66fac1 100644
--- a/protocols/IcqOscarJ/src/userinfotab.cpp
+++ b/protocols/IcqOscarJ/src/userinfotab.cpp
@@ -93,7 +93,7 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac
if (dbv.wVal != 0) {
char szExtra[80];
- mir_snprintf(str, SIZEOF(str), "%d", dbv.wVal);
+ mir_snprintf(str, "%d", dbv.wVal);
pstr = str;
if (hContact && ppro->IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 1)) {
@@ -114,7 +114,7 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac
if (pXName == NULL) // give default name
pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]);
- mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName);
+ mir_snprintf(str, "%s (%s)", pszStatus, pXName);
SAFE_FREE((void**)&pXName);
}
else strncpy_s(str, pszStatus, _TRUNCATE);
@@ -235,7 +235,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
char str[MAX_PATH];
WORD v[4];
CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v);
- mir_snprintf(str, SIZEOF(str), "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS);
+ mir_snprintf(str, "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS);
SetValue(ppro, hwndDlg, IDC_PORT, hContact, (char*)DBVT_WORD, (char*)ppro->wListenPort, SVS_ZEROISUNSPEC);
SetValue(ppro, hwndDlg, IDC_VERSION, hContact, (char*)DBVT_WORD, (char*)ICQ_VERSION, SVS_ICQVERSION);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 2d9a44c235..57b968ce96 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -176,7 +176,7 @@ static void sttAppendBufW(StringBuf *buf, const WCHAR *str)
tmp[0] = (char)*p;
tmp[1] = 0;
}
- else mir_snprintf(tmp, SIZEOF(tmp), "\\u%d ?", (int)*p);
+ else mir_snprintf(tmp, "\\u%d ?", (int)*p);
sttAppendBufRaw(buf, tmp);
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 4e1a452f77..b13aac36ff 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -441,14 +441,14 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
int count = getDword("discoWnd_favCount", 0);
for (int i=0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", i);
+ mir_snprintf(setting, "discoWnd_favName_%d", i);
ptrT tszName( getTStringA(setting));
if (tszName == NULL)
continue;
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", i);
+ mir_snprintf(setting, "discoWnd_favJID_%d", i);
ptrT dbvJid( getTStringA(setting));
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", i);
+ mir_snprintf(setting, "discoWnd_favNode_%d", i);
ptrT dbvNode( getTStringA(setting));
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid, dbvNode, tszName);
SendBothRequests(pNode, NULL);
@@ -798,7 +798,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
int count = m_proto->getDword("discoWnd_favCount", 0);
for (int i=0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", i);
+ mir_snprintf(setting, "discoWnd_favName_%d", i);
ptrT tszName( m_proto->getTStringA(setting));
if (tszName != NULL) {
HMENU hSubMenu = CreatePopupMenu();
@@ -832,11 +832,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
if (res % 10) {
res /= 10;
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", res);
+ mir_snprintf(setting, "discoWnd_favName_%d", res);
m_proto->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", res);
+ mir_snprintf(setting, "discoWnd_favJID_%d", res);
m_proto->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", res);
+ mir_snprintf(setting, "discoWnd_favNode_%d", res);
m_proto->delSetting(setting);
}
else {
@@ -846,11 +846,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", res);
+ mir_snprintf(setting, "discoWnd_favJID_%d", res);
ptrT dbv( m_proto->getTStringA(setting));
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv);
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", res);
+ mir_snprintf(setting, "discoWnd_favNode_%d", res);
dbv = m_proto->getTStringA(setting);
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv);
@@ -861,11 +861,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
int count = m_proto->getDword("discoWnd_favCount", 0);
for (int i=0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", i);
+ mir_snprintf(setting, "discoWnd_favName_%d", i);
m_proto->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", i);
+ mir_snprintf(setting, "discoWnd_favJID_%d", i);
m_proto->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", i);
+ mir_snprintf(setting, "discoWnd_favNode_%d", i);
m_proto->delSetting(setting);
}
m_proto->delSetting("discoWnd_favCount");
@@ -1334,11 +1334,11 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
{
char setting[MAXMODULELABELLENGTH];
int count = getDword("discoWnd_favCount", 0);
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", count);
+ mir_snprintf(setting, "discoWnd_favName_%d", count);
setTString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", count);
+ mir_snprintf(setting, "discoWnd_favJID_%d", count);
setTString(setting, pNode->GetJid());
- mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", count);
+ mir_snprintf(setting, "discoWnd_favNode_%d", count);
setTString(setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
setDword("discoWnd_favCount", ++count);
}
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index d962cac51e..d4bfc3dd61 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -48,7 +48,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft)
ft->s = info.s;
char buffer[JABBER_NETWORK_BUFFER_SIZE];
- int datalen = mir_snprintf(buffer, SIZEOF(buffer), "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", ft->httpPath, ft->httpHostName);
+ int datalen = mir_snprintf(buffer, "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", ft->httpPath, ft->httpHostName);
info.send(buffer, datalen);
ft->state = FT_CONNECTING;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 4736324897..81b37b400e 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -119,16 +119,16 @@ struct JabberGcRecentInfo
BOOL loadRecent(int iRecent)
{
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_server", iRecent);
+ mir_snprintf(setting, "rcMuc_%d_server", iRecent);
server = ppro->getTStringA(setting);
- mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_room", iRecent);
+ mir_snprintf(setting, "rcMuc_%d_room", iRecent);
room = ppro->getTStringA(setting);
- mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_nick", iRecent);
+ mir_snprintf(setting, "rcMuc_%d_nick", iRecent);
nick = ppro->getTStringA(setting);
- mir_snprintf(setting, SIZEOF(setting), "password_rcMuc_%d", iRecent);
+ mir_snprintf(setting, "password_rcMuc_%d", iRecent);
password = ppro->getTStringA(NULL, setting);
return room || server || nick || password;
@@ -138,25 +138,25 @@ struct JabberGcRecentInfo
{
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_server", iRecent);
+ mir_snprintf(setting, "rcMuc_%d_server", iRecent);
if (server)
ppro->setTString(setting, server);
else
ppro->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_room", iRecent);
+ mir_snprintf(setting, "rcMuc_%d_room", iRecent);
if (room)
ppro->setTString(setting, room);
else
ppro->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_nick", iRecent);
+ mir_snprintf(setting, "rcMuc_%d_nick", iRecent);
if (nick)
ppro->setTString(setting, nick);
else
ppro->delSetting(setting);
- mir_snprintf(setting, SIZEOF(setting), "password_rcMuc_%d", iRecent);
+ mir_snprintf(setting, "password_rcMuc_%d", iRecent);
if (password)
ppro->setTString(setting, password);
else
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 131a3b0ced..252da69c2f 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -741,7 +741,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams)
{
char szService[256];
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, JS_HTTP_AUTH);
+ mir_snprintf(szService, "%s%s", m_szModuleName, JS_HTTP_AUTH);
CLISTEVENT cle = { 0 };
cle.cbSize = sizeof(CLISTEVENT);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 8927b0f816..a51eefa6a2 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -462,10 +462,10 @@ void CJabberProto::SetContactOfflineStatus(MCONTACT hContact)
void CJabberProto::InitPopups(void)
{
TCHAR desc[256];
- mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors"));
+ mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors"));
char name[256];
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
@@ -490,7 +490,7 @@ void CJabberProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *
ppd.ptszText = szMsg;
ppd.pszClassName = name;
ppd.hContact = hContact;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error");
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index c993dc746b..e493e54c0d 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -780,7 +780,7 @@ bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml)
CLISTEVENT cle = { 0 };
char szService[256];
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT);
+ mir_snprintf(szService, "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT);
cle.cbSize = sizeof(CLISTEVENT);
cle.hIcon = (HICON)LoadIconEx("notes");
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR;
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index a364050197..5bebb8ac3a 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -297,7 +297,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge)
char buf[4096];
ptrA encproof(mir_base64_encode((PBYTE)clientProof, sizeof(clientProof)));
- int cbLen = mir_snprintf(buf, SIZEOF(buf), "c=biws,r=%s,p=%s", snonce, encproof);
+ int cbLen = mir_snprintf(buf, "c=biws,r=%s,p=%s", snonce, encproof);
return mir_base64_encode((PBYTE)buf, cbLen);
}
@@ -310,7 +310,7 @@ char* TScramAuth::getInitialRequest()
cnonce = mir_base64_encode((PBYTE)nonce, sizeof(nonce));
char buf[4096];
- int cbLen = mir_snprintf(buf, SIZEOF(buf), "n,,n=%s,r=%s", uname, cnonce);
+ int cbLen = mir_snprintf(buf, "n,,n=%s,r=%s", uname, cnonce);
msg1 = mir_strdup(buf + 3);
return mir_base64_encode((PBYTE)buf, cbLen);
}
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index b6a142b90f..662240451c 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -692,7 +692,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par
{
for (int i = 0; i < recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s%d", param, i);
+ mir_snprintf(setting, "%s%d", param, i);
ptrT tszRecent(getTStringA(setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, tszRecent);
@@ -716,7 +716,7 @@ void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param
id = getByte(param, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s%d", param, id);
+ mir_snprintf(setting, "%s%d", param, id);
setTString(setting, string);
setByte(param, (id + 1) % recentCount);
}
@@ -769,7 +769,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
char name[128];
char *jid_copy = mir_t2a(item->jid);
- mir_snprintf(name, SIZEOF(name), "$/Transports/%s", jid_copy);
+ mir_snprintf(name, "$/Transports/%s", jid_copy);
ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact);
ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (TCHAR *)item->jid);
ppro->m_pInfoFrame->SetInfoItemCallback(name, &CJabberProto::InfoFrame_OnTransport);
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index c4860f67ad..510abac8ac 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -552,12 +552,12 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
SetWindowText(hwndDlg, TranslateT("Jabber vCard: Edit Email Address"));
char idstr[33];
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id);
+ mir_snprintf(idstr, "e-mail%d", dat->id);
ptrA email(dat->ppro->getStringA(idstr));
if (email != NULL)
SetDlgItemTextA(hwndDlg, IDC_EMAIL, email);
- mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", lParam);
+ mir_snprintf(idstr, "e-mailFlag%d", lParam);
WORD nFlag = dat->ppro->getWord(idstr, 0);
if (nFlag & JABBER_VCEMAIL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, BST_CHECKED);
if (nFlag & JABBER_VCEMAIL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, BST_CHECKED);
@@ -573,14 +573,14 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (dat->id < 0)
for (dat->id = 0;; dat->id++) {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id);
+ mir_snprintf(idstr, "e-mail%d", dat->id);
if (ptrA(dat->ppro->getStringA(idstr)) == NULL)
break;
}
TCHAR text[128];
GetDlgItemText(hwndDlg, IDC_EMAIL, text, SIZEOF(text));
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id);
+ mir_snprintf(idstr, "e-mail%d", dat->id);
dat->ppro->setTString(idstr, text);
{
WORD nFlag = 0;
@@ -588,7 +588,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCEMAIL_WORK;
if (IsDlgButtonChecked(hwndDlg, IDC_INTERNET)) nFlag |= JABBER_VCEMAIL_INTERNET;
if (IsDlgButtonChecked(hwndDlg, IDC_X400)) nFlag |= JABBER_VCEMAIL_X400;
- mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", dat->id);
+ mir_snprintf(idstr, "e-mailFlag%d", dat->id);
dat->ppro->setWord(idstr, nFlag);
}
// fall through
@@ -614,12 +614,12 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
SetWindowText(hwndDlg, TranslateT("Jabber vCard: Edit Phone Number"));
char idstr[33];
- mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", dat->id);
+ mir_snprintf(idstr, "Phone%d", dat->id);
ptrA phone(dat->ppro->getStringA(idstr));
if (phone != NULL)
SetDlgItemTextA(hwndDlg, IDC_PHONE, phone);
- mir_snprintf(idstr, SIZEOF(idstr), "PhoneFlag%d", dat->id);
+ mir_snprintf(idstr, "PhoneFlag%d", dat->id);
int nFlag = dat->ppro->getWord(idstr, 0);
if (nFlag & JABBER_VCTEL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, BST_CHECKED);
if (nFlag & JABBER_VCTEL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, BST_CHECKED);
@@ -644,14 +644,14 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (dat->id < 0)
for (dat->id = 0;; dat->id++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", dat->id);
+ mir_snprintf(idstr, "Phone%d", dat->id);
if (ptrA(dat->ppro->getStringA(idstr)) == NULL)
break;
}
char text[128];
GetDlgItemTextA(hwndDlg, IDC_PHONE, text, SIZEOF(text));
- mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", dat->id);
+ mir_snprintf(idstr, "Phone%d", dat->id);
dat->ppro->setString(idstr, text);
WORD nFlag = 0;
@@ -667,7 +667,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (IsDlgButtonChecked(hwndDlg, IDC_MODEM)) nFlag |= JABBER_VCTEL_MODEM;
if (IsDlgButtonChecked(hwndDlg, IDC_ISDN)) nFlag |= JABBER_VCTEL_ISDN;
if (IsDlgButtonChecked(hwndDlg, IDC_PCS)) nFlag |= JABBER_VCTEL_PCS;
- mir_snprintf(idstr, SIZEOF(idstr), "PhoneFlag%d", dat->id);
+ mir_snprintf(idstr, "PhoneFlag%d", dat->id);
dat->ppro->setWord(idstr, nFlag);
}
// fall through
@@ -729,7 +729,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
+ mir_snprintf(idstr, "e-mail%d", i);
ptrT email( ppro->getTStringA(idstr));
if (email == NULL) break;
@@ -750,7 +750,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", i);
+ mir_snprintf(idstr, "Phone%d", i);
ptrT phone( ppro->getTStringA(idstr));
if (phone == NULL) break;
@@ -860,20 +860,20 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
int i;
for (i = lvi.lParam;; i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i + 1);
+ mir_snprintf(idstr, szIdTemplate, i + 1);
ptrA fieldVal(ppro->getStringA(idstr));
if (fieldVal == NULL) break;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
ppro->setString(idstr, fieldVal);
- mir_snprintf(idstr, SIZEOF(idstr), szFlagTemplate, i + 1);
+ mir_snprintf(idstr, szFlagTemplate, i + 1);
WORD nFlag = ppro->getWord(idstr, 0);
- mir_snprintf(idstr, SIZEOF(idstr), szFlagTemplate, i);
+ mir_snprintf(idstr, szFlagTemplate, i);
ppro->setWord(idstr, nFlag);
}
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
ppro->delSetting(idstr);
- mir_snprintf(idstr, SIZEOF(idstr), szFlagTemplate, i);
+ mir_snprintf(idstr, szFlagTemplate, i);
ppro->delSetting(idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
ppro->m_vCardUpdates |= (1UL << iPageId);
@@ -1032,7 +1032,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
AppendVcardFromDB(v, "GENDER", "GenderString");
for (i = 0;; i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
+ mir_snprintf(idstr, "e-mail%d", i);
ptrT email(getTStringA(idstr));
if (email == NULL)
break;
@@ -1040,7 +1040,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
HXML e = v << XCHILD(_T("EMAIL"), email);
AppendVcardFromDB(e, "USERID", idstr);
- mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", i);
+ mir_snprintf(idstr, "e-mailFlag%d", i);
WORD nFlag = getWord(idstr, 0);
if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD(_T("HOME"));
if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD(_T("WORK"));
@@ -1080,7 +1080,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
AppendVcardFromDB(v, "DESC", "About");
for (i = 0;; i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", i);
+ mir_snprintf(idstr, "Phone%d", i);
ptrT phone(getTStringA(idstr));
if (phone == NULL)
break;
@@ -1088,7 +1088,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
n = v << XCHILD(_T("TEL"));
AppendVcardFromDB(n, "NUMBER", idstr);
- mir_snprintf(idstr, SIZEOF(idstr), "PhoneFlag%d", i);
+ mir_snprintf(idstr, "PhoneFlag%d", i);
WORD nFlag = getWord(idstr, 0);
if (nFlag & JABBER_VCTEL_HOME) n << XCHILD(_T("HOME"));
if (nFlag & JABBER_VCTEL_WORK) n << XCHILD(_T("WORK"));
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 49f1bd03a5..473f0b5292 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -276,14 +276,14 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *)
if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
TCHAR *txt = m_txtDescription.GetText();
- mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
+ mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
m_proto->setTString(szSetting, txt);
mir_free(txt);
}
m_prevSelected = m_cbModes.GetCurSel();
if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
+ mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
ptrT szDescr( m_proto->getTStringA(szSetting));
m_txtDescription.SetText((szDescr != NULL) ? szDescr : _T(""));
@@ -447,7 +447,7 @@ CPepGuiService::~CPepGuiService()
void CPepGuiService::InitGui()
{
char szService[128];
- mir_snprintf(szService, SIZEOF(szService), "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name);
+ mir_snprintf(szService, "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name);
int(__cdecl CPepGuiService::*serviceProc)(WPARAM, LPARAM);
serviceProc = &CPepGuiService::OnMenuItemClick;
@@ -463,7 +463,7 @@ void CPepGuiService::RebuildMenu()
return;
char szService[128];
- mir_snprintf(szService, SIZEOF(szService), "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name);
+ mir_snprintf(szService, "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name);
CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hJabberRoot;
@@ -1446,7 +1446,7 @@ INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM, LPARAM lParam)
void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot)
{
char szSetting[256];
- mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "AdvStatus/%s/%s", m_szModuleName, pszSlot);
db_set_resident(szSetting, "id");
db_set_resident(szSetting, "icon");
db_set_resident(szSetting, "title");
@@ -1456,16 +1456,16 @@ void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot)
void CJabberProto::ResetAdvStatus(MCONTACT hContact, const char *pszSlot)
{
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/id", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/id", m_szModuleName, pszSlot);
db_unset(hContact, "AdvStatus", szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/icon", m_szModuleName, pszSlot);
db_unset(hContact, "AdvStatus", szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/title", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/title", m_szModuleName, pszSlot);
db_unset(hContact, "AdvStatus", szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/text", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/text", m_szModuleName, pszSlot);
db_unset(hContact, "AdvStatus", szSetting);
}
@@ -1473,16 +1473,16 @@ void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const
{
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/id", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/id", m_szModuleName, pszSlot);
db_set_ts(hContact, "AdvStatus", szSetting, pszMode);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/icon", m_szModuleName, pszSlot);
db_set_s(hContact, "AdvStatus", szSetting, pszIcon);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/title", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/title", m_szModuleName, pszSlot);
db_set_ts(hContact, "AdvStatus", szSetting, pszTitle);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/text", m_szModuleName, pszSlot);
+ mir_snprintf(szSetting, "%s/%s/text", m_szModuleName, pszSlot);
if (pszText)
db_set_ts(hContact, "AdvStatus", szSetting, pszText);
else
@@ -1492,14 +1492,14 @@ void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const
char* CJabberProto::ReadAdvStatusA(MCONTACT hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
+ mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
return db_get_sa(hContact, "AdvStatus", szSetting);
}
TCHAR* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
+ mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
return db_get_tsa(hContact, "AdvStatus", szSetting);
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index d2f84ff04f..f7ef7aa58c 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -150,7 +150,7 @@ CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList)
CMStringA res;
for (size_t i = 0; i < pmalAddrList->dwAddrCount; i++) {
char buf[100];
- mir_snprintf(buf, SIZEOF(buf), "%s:%lu;", inet_ntoa((*((in_addr*)&pmalAddrList->pMailAddress[i].dwAddr))), pmalAddrList->pMailAddress[i].dwPort);
+ mir_snprintf(buf, "%s:%lu;", inet_ntoa((*((in_addr*)&pmalAddrList->pMailAddress[i].dwAddr))), pmalAddrList->pMailAddress[i].dwPort);
res += buf;
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp
index e97bfdf5ac..4d27ea4e4e 100644
--- a/protocols/MRA/src/Mra_svcs.cpp
+++ b/protocols/MRA/src/Mra_svcs.cpp
@@ -487,7 +487,7 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam)
// fill status message member
if (pData->flags & CSSF_MASK_MESSAGE) {
char szSetting[100];
- mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", m_iXStatus);
+ mir_snprintf(szSetting, "XStatus%dMsg", m_iXStatus);
if (pData->flags & CSSF_UNICODE)
mraGetStaticStringW(hContact, szSetting, pData->pwszMessage, (STATUS_DESC_MAX + 1), NULL);
else
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp
index b79ddcb6af..7ae6366836 100644
--- a/protocols/MSN/src/msn_contact.cpp
+++ b/protocols/MSN/src/msn_contact.cpp
@@ -113,13 +113,13 @@ void CMsnProto::AddDelUserContList(const char* email, const int list, const int
if (list < LIST_RL) {
const char* dom = strchr(email, '@');
if (dom == NULL) {
- sz = mir_snprintf(buf, SIZEOF(buf),
+ sz = mir_snprintf(buf,
"<ml><t><c n=\"%s\" l=\"%d\"/></t></ml>",
email, list);
}
else {
*(char*)dom = 0;
- sz = mir_snprintf(buf, SIZEOF(buf),
+ sz = mir_snprintf(buf,
"<ml><d n=\"%s\"><c n=\"%s\" l=\"%d\" t=\"%d\"/></d></ml>",
dom + 1, email, list, netId);
*(char*)dom = '@';
@@ -257,7 +257,7 @@ void CMsnProto::MSN_FindYahooUser(const char* email)
size_t sz;
*(char*)dom = '\0';
- sz = mir_snprintf(buf, SIZEOF(buf), "<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>", dom + 1, email);
+ sz = mir_snprintf(buf, "<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>", dom + 1, email);
*(char*)dom = '@';
msnNsThread->sendPacket("FQY", "%d\r\n%s", sz, buf);
}
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
index 87587e24d0..10a968681d 100644
--- a/protocols/MSN/src/msn_mail.cpp
+++ b/protocols/MSN/src/msn_mail.cpp
@@ -295,7 +295,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)
cle.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL);
cle.ptszTooltip = tBuffer2;
char buf[64];
- mir_snprintf(buf, SIZEOF(buf), "%s%s", m_szModuleName, MS_GOTO_INBOX);
+ mir_snprintf(buf, "%s%s", m_szModuleName, MS_GOTO_INBOX);
cle.pszService = buf;
CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
@@ -317,7 +317,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)
msgurl = "inbox";
char szUrl[256];
- mir_snprintf(szUrl, SIZEOF(szUrl), "http://mail.live.com?rru=%s", msgurl);
+ mir_snprintf(szUrl, "http://mail.live.com?rru=%s", msgurl);
MSN_ShowPopup(tBuffer, tBuffer2,
MSN_ALLOW_ENTER | MSN_ALLOW_MSGBOX | MSN_HOTMAIL_POPUP,
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index b788bee022..2160bd233b 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -154,7 +154,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl)
if (i == 0)
mir_strcpy(szSetting, "Url");
else
- mir_snprintf(szSetting, SIZEOF(szSetting), "Url%d", i);
+ mir_snprintf(szSetting, "Url%d", i);
pszUrlAttr = ezxml_attr(xmli, szSetting);
if (pszUrlAttr == NULL)
break;
@@ -1021,15 +1021,15 @@ void CMsnProto::InitPopups(void)
ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppc.iSeconds = 3;
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Hotmail"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Hotmail");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Hotmail"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Hotmail");
hPopupHotmail = Popup_RegisterClass(&ppc);
ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppc.iSeconds = 3;
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notify");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Notify");
hPopupNotify = Popup_RegisterClass(&ppc);
ppc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
@@ -1037,8 +1037,8 @@ void CMsnProto::InitPopups(void)
ppc.colorText = RGB(255, 245, 225); //Yellow
ppc.iSeconds = 60;
- mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Error"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
hPopupError = Popup_RegisterClass(&ppc);
}
@@ -1073,11 +1073,11 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)
ppd.pszClassName = name;
if (pud->flags & MSN_SHOW_ERROR)
- mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Error");
+ mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Error");
else if (pud->flags & (MSN_HOTMAIL_POPUP | MSN_ALERT_POPUP))
- mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Hotmail");
+ mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Hotmail");
else
- mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Notify");
+ mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Notify");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp
index 48afb659bd..02f1ead4d4 100644
--- a/protocols/MSN/src/msn_soapab.cpp
+++ b/protocols/MSN/src/msn_soapab.cpp
@@ -401,7 +401,7 @@ bool CMsnProto::MSN_SharingAddDelMember(const char* szEmail, const int listId, c
ezxml_set_txt(node, "MSN.IM.BuddyType");
node = ezxml_add_child(anot, "Value", 0);
- mir_snprintf(buf, SIZEOF(buf), "%02d:", netId);
+ mir_snprintf(buf, "%02d:", netId);
ezxml_set_txt(node, buf);
}
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index a0e1d19c0c..4998a0b344 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -361,7 +361,7 @@ bool Omegle_client::start()
std::string count = get_page( OMEGLE_REQUEST_COUNT );
if (!count.empty()) {
char str[255];
- mir_snprintf(str, SIZEOF(str), Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str());
+ mir_snprintf(str, Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str());
TCHAR *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
@@ -369,7 +369,7 @@ bool Omegle_client::start()
}
} else {
char str[255];
- mir_snprintf(str, SIZEOF(str), Translate("Connected to server %s."), server_.c_str());
+ mir_snprintf(str, Translate("Connected to server %s."), server_.c_str());
TCHAR *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
@@ -481,7 +481,7 @@ bool Omegle_client::events()
std::string count = utils::text::trim( resp.data.substr(pos, resp.data.find("]", pos) - pos));
char str[255];
- mir_snprintf(str, SIZEOF(str), Translate("On whole Omegle are %s strangers online now."), count.c_str());
+ mir_snprintf(str, Translate("On whole Omegle are %s strangers online now."), count.c_str());
TCHAR *msg = mir_a2t_cp(str,CP_UTF8);
parent->UpdateChat(NULL, msg);
@@ -635,7 +635,7 @@ bool Omegle_client::events()
resp.data.substr(pos, resp.data.find("\"]", pos) - pos) )) );
char str[255];
- mir_snprintf(str, SIZEOF(str), Translate("%s disconnected."), Translate(stranger.c_str()));
+ mir_snprintf(str, Translate("%s disconnected."), Translate(stranger.c_str()));
TCHAR *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp
index 6d631fc2ce..a38c1e44d4 100644
--- a/protocols/Sametime/src/userlist.cpp
+++ b/protocols/Sametime/src/userlist.cpp
@@ -154,15 +154,15 @@ void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temp
group_type = mwSametimeGroup_getType(stgroup);
group_open = (mwSametimeGroup_isOpen(stgroup) != 0);
- mir_snprintf(buff, SIZEOF(buff), "GN_%s", group_alias);
+ mir_snprintf(buff, "GN_%s", group_alias);
db_set_utf(0, szProtoGroups, buff, group_name);
- mir_snprintf(buff, SIZEOF(buff), "GT_%s", group_alias);
+ mir_snprintf(buff, "GT_%s", group_alias);
db_set_b(0, szProtoGroups, buff, (BYTE)group_type);
- mir_snprintf(buff, SIZEOF(buff), "GO_%s", group_alias);
+ mir_snprintf(buff, "GO_%s", group_alias);
db_set_b(0, szProtoGroups, buff, (BYTE)(group_open ? 1 : 0));
// inverse mapping
- mir_snprintf(buff, SIZEOF(buff), "GA_%s", group_name);
+ mir_snprintf(buff, "GA_%s", group_name);
db_set_utf(0, szProtoGroups, buff, group_alias);
AddGroup(group_alias, group_open);
@@ -223,7 +223,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
group_alias = _strdup(Translate("None"));
if (group_alias) {
- mir_snprintf(buff, SIZEOF(buff), "GT_%s", group_alias);
+ mir_snprintf(buff, "GT_%s", group_alias);
group_type = (mwSametimeGroupType)db_get_b(0, szProtoGroups, buff, (BYTE)mwSametimeGroup_NORMAL);
// apparently we don't want to upload contacts in dynamic groups - see gaim sametime plugin comments
if (group_type == mwSametimeGroup_DYNAMIC) {
@@ -234,7 +234,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
continue;
}
- mir_snprintf(buff, SIZEOF(buff), "GN_%s", group_alias);
+ mir_snprintf(buff, "GN_%s", group_alias);
if (!db_get_utf(0, szProtoGroups, buff, &dbv2)) {
group_name = _strdup(dbv2.pszVal);
db_free(&dbv2);
@@ -252,7 +252,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
group_open = (expanded != 0);
}
else {
- mir_snprintf(buff, SIZEOF(buff), "GO_%s", group_alias);
+ mir_snprintf(buff, "GO_%s", group_alias);
group_open = (db_get_b(0, szProtoGroups, buff, 0) == 1);
}
@@ -505,7 +505,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware)
mwSametimeList* user_list = mwSametimeList_new();
mwSametimeGroup* stgroup = mwSametimeGroup_new(user_list, mwSametimeGroup_DYNAMIC, aware->group);
char buff[256];
- mir_snprintf(buff, SIZEOF(buff), "GA_%s", aware->group);
+ mir_snprintf(buff, "GA_%s", aware->group);
if (!db_get_utf(0, proto->szProtoGroups, buff, &dbv)) {
mwSametimeGroup_setAlias(stgroup, dbv.pszVal);
db_free(&dbv);
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index e848d2920d..8f1339f374 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -94,8 +94,8 @@ void CSkypeProto::InitPopups()
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
- mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Calls"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Call");
+ mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Calls"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Call");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("inc_call"));
@@ -105,8 +105,8 @@ void CSkypeProto::InitPopups()
ppc.PluginWindowProc = PopupDlgProcCall;
m_hPopupClassCall = Popup_RegisterClass(&ppc);
- mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Notifications"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification");
+ mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Notifications"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("notify"));
@@ -115,8 +115,8 @@ void CSkypeProto::InitPopups()
ppc.iSeconds = 5;
m_hPopupClassNotify = Popup_RegisterClass(&ppc);
- mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("error"));
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp
index fc8f9f26ac..a6a7f39bd4 100644
--- a/protocols/Tlen/src/tlen_iqid.cpp
+++ b/protocols/Tlen/src/tlen_iqid.cpp
@@ -596,7 +596,7 @@ void TlenIqResultInfo(TlenProtocol *proto, XmlNode *iqNode)
if (hContact != NULL) {
if (item->software == NULL) {
char str[128];
- mir_snprintf(str, SIZEOF(str), "Tlen Protocol %s", item->protocolVersion);
+ mir_snprintf(str, "Tlen Protocol %s", item->protocolVersion);
db_set_s(hContact, proto->m_szModuleName, "MirVer", str);
}
}
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp
index f440c97f57..2b733f6285 100644
--- a/protocols/Tlen/src/tlen_muc.cpp
+++ b/protocols/Tlen/src/tlen_muc.cpp
@@ -152,7 +152,7 @@ static int TlenMUCSendPresence(TlenProtocol *proto, const char *roomID, const ch
return 1;
}
if (nick != NULL) {
- mir_snprintf(str, SIZEOF(str), "%s/%s", roomID, nick);
+ mir_snprintf(str, "%s/%s", roomID, nick);
} else {
strncpy_s(str, roomID, _TRUNCATE);
}
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp
index cb72d33849..a582ef2a43 100644
--- a/protocols/Tlen/src/tlen_p2p_old.cpp
+++ b/protocols/Tlen/src/tlen_p2p_old.cpp
@@ -159,7 +159,7 @@ void TlenP2PEstablishOutgoingConnection(TLEN_FILE_TRANSFER *ft, BOOL sendAck)
TlenP2PPacketSetType(packet, TLEN_FILE_PACKET_CONNECTION_REQUEST);
TlenP2PPacketPackDword(packet, 1);
TlenP2PPacketPackDword(packet, (DWORD) atoi(ft->iqId));
- size_t srt_len = mir_snprintf(str, SIZEOF(str), "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId));
+ size_t srt_len = mir_snprintf(str, "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId));
char *hash = TlenSha1(str, (int)srt_len);
TlenP2PPacketPackBuffer(packet, hash, 20);
mir_free(hash);
@@ -202,12 +202,12 @@ TLEN_FILE_TRANSFER* TlenP2PEstablishIncomingConnection(TlenProtocol *proto, HAND
while ((i=TlenListFindNext(proto, list, i)) >= 0) {
item = TlenListGetItemPtrFromIndex(proto, i);
if (item != NULL) {
- mir_snprintf(str, SIZEOF(str), "%d", iqId);
+ mir_snprintf(str, "%d", iqId);
if (!mir_strcmp(item->ft->iqId, str)) {
char *hash, *nick;
int j;
nick = TlenNickFromJID(item->ft->jid);
- j = mir_snprintf(str, SIZEOF(str), "%08X%s%d", iqId, nick, iqId);
+ j = mir_snprintf(str, "%08X%s%d", iqId, nick, iqId);
mir_free(nick);
hash = TlenSha1(str, j);
for (j=0;j<20;j++) {
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index f614b0a323..f6c86885b8 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -476,7 +476,7 @@ static void TlenProcessStreamClosing(XmlNode *node, ThreadData *info)
Netlib_CloseHandle(info->proto);
if (node->name && !mir_strcmp(node->name, "stream:error") && node->text){
char buffer[1024];
- mir_snprintf(buffer, SIZEOF(buffer), "%s\n%s", Translate("Tlen Connection Error"), Translate(node->text));
+ mir_snprintf(buffer, "%s\n%s", Translate("Tlen Connection Error"), Translate(node->text));
PUShowMessage(buffer, SM_WARNING);
} else if (!mir_strcmp(node->name, "s")){
info->proto->debugLogA("Disconnected server message");
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index 70bf723c23..a08e906761 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -845,7 +845,7 @@ static INT_PTR CALLBACK TlenVoiceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
else {
fv = 0;
}
- mir_snprintf(str, SIZEOF(str), "%.1f kB/s", fv / 1024);
+ mir_snprintf(str, "%.1f kB/s", fv / 1024);
SetDlgItemTextA(hwndDlg, IDC_BYTESOUT, str);
if (proto->playbackControl != NULL) {
fv = (float)proto->playbackControl->bytesSum;
@@ -854,7 +854,7 @@ static INT_PTR CALLBACK TlenVoiceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
else {
fv = 0;
}
- mir_snprintf(str, SIZEOF(str), "%.1f kB/s", fv / 1024);
+ mir_snprintf(str, "%.1f kB/s", fv / 1024);
SetDlgItemTextA(hwndDlg, IDC_BYTESIN, str);
}
break;
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp
index 2068b64a44..ff55177d1a 100644
--- a/protocols/Tox/src/tox_multimedia.cpp
+++ b/protocols/Tox/src/tox_multimedia.cpp
@@ -321,7 +321,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam)
cle.ptszTooltip = szTooltip;
char szService[MAX_PATH];
- mir_snprintf(szService, SIZEOF(szService), "%s/Audio/Ring", GetContactProto(hContact));
+ mir_snprintf(szService, "%s/Audio/Ring", GetContactProto(hContact));
cle.pszService = szService;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp
index 860f5c5798..26958fbeef 100644
--- a/protocols/Tox/src/tox_network.cpp
+++ b/protocols/Tox/src/tox_network.cpp
@@ -27,16 +27,16 @@ void CToxProto::BootstrapNodesFromDb(bool isIPv6)
char setting[MAX_PATH];
for (int i = 0; i < nodeCount; i++)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i);
ptrA address(db_get_sa(NULL, module, setting));
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i);
int port = db_get_w(NULL, module, setting, 33445);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i);
ptrA pubKey(db_get_sa(NULL, module, setting));
BootstrapNode(address, port, pubKey);
if (isIPv6)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i);
address = db_get_sa(NULL, module, setting);
BootstrapNode(address, port, pubKey);
}
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index 0023c60141..1e5d270231 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -428,15 +428,15 @@ void CToxOptionsNodeList::OnInitDialog()
int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
for (int i = 0; i < nodeCount; i++)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i);
ptrT value(db_get_tsa(NULL, module, setting));
iItem = m_nodes.AddItem(value, -1, NULL, 1);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i);
value = db_get_tsa(NULL, module, setting);
m_nodes.SetItem(iItem, 1, value);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i);
int port = db_get_w(NULL, module, setting, 0);
if (port > 0)
{
@@ -445,7 +445,7 @@ void CToxOptionsNodeList::OnInitDialog()
m_nodes.SetItem(iItem, 2, mir_a2t(portNum));
}
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i);
value = db_get_tsa(NULL, module, setting);
m_nodes.SetItem(iItem, 3, value);
@@ -547,22 +547,22 @@ void CToxOptionsNodeList::OnApply()
lvi.mask = LVIF_TEXT;
lvi.iSubItem = 0;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem);
db_set_s(NULL, module, setting, _T2A(lvi.pszText));
lvi.iSubItem = 1;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem);
db_set_s(NULL, module, setting, _T2A(lvi.pszText));
lvi.iSubItem = 2;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem);
db_set_w(NULL, module, setting, _ttoi(lvi.pszText));
lvi.iSubItem = 3;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem);
db_set_s(NULL, module, setting, _T2A(lvi.pszText));
iItem++;
@@ -571,13 +571,13 @@ void CToxOptionsNodeList::OnApply()
int nodeCount = db_get_b(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
for (iItem = itemCount; iItem < nodeCount; iItem++)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem);
db_unset(NULL, module, setting);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem);
db_unset(NULL, module, setting);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem);
db_unset(NULL, module, setting);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem);
db_unset(NULL, module, setting);
}
db_set_b(NULL, module, TOX_SETTINGS_NODE_COUNT, itemCount);
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp
index a0232d5da2..c1575bd090 100644
--- a/protocols/Twitter/src/ui.cpp
+++ b/protocols/Twitter/src/ui.cpp
@@ -138,7 +138,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
else if (LOWORD(wParam) == IDC_TWEETMSG && HIWORD(wParam) == EN_CHANGE) {
size_t len = SendDlgItemMessage(hwndDlg, IDC_TWEETMSG, WM_GETTEXTLENGTH, 0, 0);
char str[16];
- mir_snprintf(str, SIZEOF(str), "%d", 140 - len);
+ mir_snprintf(str, "%d", 140 - len);
SetDlgItemTextA(hwndDlg, IDC_CHARACTERS, str);
return true;
@@ -154,7 +154,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
SendDlgItemMessage(hwndDlg, IDC_TWEETMSG, EM_SETSEL, len, len);
char str[16];
- mir_snprintf(str, SIZEOF(str), "%d", 140 - len);
+ mir_snprintf(str, "%d", 140 - len);
SetDlgItemTextA(hwndDlg, IDC_CHARACTERS, str);
return true;
@@ -393,7 +393,7 @@ INT_PTR CALLBACK popup_options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
CheckAndUpdateDlgButton(hwndDlg, IDC_TIMEOUT_PERMANENT, true);
else {
char str[32];
- mir_snprintf(str, SIZEOF(str), "%d", timeout);
+ mir_snprintf(str, "%d", timeout);
SetDlgItemTextA(hwndDlg, IDC_TIMEOUT, str);
CheckAndUpdateDlgButton(hwndDlg, IDC_TIMEOUT_CUSTOM, true);
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 887cafdf8c..28f0e88289 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -198,35 +198,35 @@ void CVkProto::InitMenus()
mi.flags = CMIF_CHILDPOPUP;
mi.hParentMenu = MO_GetProtoRootMenu(m_szModuleName);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_CREATECHAT);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_CREATECHAT);
mi.pszService = szService;
mi.position = 10009 + PMI_CREATECHAT;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);
mi.pszName = LPGEN("Create new chat");
g_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_SETSTATUSMSG);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_SETSTATUSMSG);
mi.pszService = szService;
mi.position = 10009 + PMI_SETSTATUSMSG;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_STATUS));
mi.pszName = LPGEN("Status message");
g_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_WALLPOST);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST);
mi.pszService = szService;
mi.position = 10009 + PMI_WALLPOST;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_WALL));
mi.pszName = LPGEN("Send message to my wall");
g_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_LOADVKNEWS);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS);
mi.pszService = szService;
mi.position = 10009 + PMI_LOADVKNEWS;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
mi.pszName = LPGEN("Load news from VK");
g_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_VISITPROFILE);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_VISITPROFILE);
mi.pszService = szService;
mi.position = 10009 + PMI_VISITPROFILE;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
@@ -241,56 +241,56 @@ void CVkProto::InitMenus()
mi.ptszName = LPGENT("Visit profile");
g_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_WALLPOST);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST);
mi.position = -200001000 + CMI_WALLPOST;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_WALL));
mi.ptszName = LPGENT("Send message to user\'s wall");
mi.pszService = szService;
g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_ADDASFRIEND);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_ADDASFRIEND);
mi.position = -200001000 + CMI_ADDASFRIEND;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
mi.ptszName = LPGENT("Add as friend");
mi.pszService = szService;
g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_DELETEFRIEND);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_DELETEFRIEND);
mi.position = -200001000 + CMI_DELETEFRIEND;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.ptszName = LPGENT("Delete from friend list");
mi.pszService = szService;
g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_BANUSER);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_BANUSER);
mi.position = -200001000 + CMI_BANUSER;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BAN));
mi.ptszName = LPGENT("Ban user");
mi.pszService = szService;
g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_REPORTABUSE);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_REPORTABUSE);
mi.position = -200001000 + CMI_REPORTABUSE;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_ABUSE));
mi.ptszName = LPGENT("Report abuse");
mi.pszService = szService;
g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_DESTROYKICKCHAT);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_DESTROYKICKCHAT);
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.ptszName = LPGENT("Destroy room");
mi.pszService = szService;
g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_OPENBROADCAST);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_OPENBROADCAST);
mi.position = -200001000 + CMI_OPENBROADCAST;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
mi.ptszName = LPGENT("Open broadcast");
mi.pszService = szService;
g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_LOADVKNEWS);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS);
mi.pszService = szService;
mi.position = -200001000 + CMI_LOADVKNEWS;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
@@ -298,7 +298,7 @@ void CVkProto::InitMenus()
g_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi);
// Sync history menu
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORY);
mi.position = -200001000 + CMI_GETSERVERHISTORY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("Reload messages from vk.com...");
@@ -308,42 +308,42 @@ void CVkProto::InitMenus()
mi.flags |= CMIF_CHILDPOPUP;
mi.hParentMenu = g_hContactMenuItems[CMI_GETSERVERHISTORY];
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 1 day");
mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 3 days");
mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last week");
mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 30 days");
mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 90 days");
mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi);
- mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY);
+ mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORY;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for all time");
@@ -394,8 +394,8 @@ void CVkProto::InitPopups(void)
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
- mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = LoadSkinnedIcon(SKINICON_ERROR);
@@ -404,8 +404,8 @@ void CVkProto::InitPopups(void)
ppc.iSeconds = 60;
m_hPopupClassError = Popup_RegisterClass(&ppc);
- mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Notification"));
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification");
+ mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Notification"));
+ mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
ppc.ptszDescription = desc;
ppc.pszName = name;
ppc.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
@@ -425,7 +425,7 @@ void CVkProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTi
ppd.ptszText = szMsg;
ppd.pszClassName = name;
ppd.hContact = hContact;
- mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, err ? "Error" : "Notification");
+ mir_snprintf(name, "%s_%s", m_szModuleName, err ? "Error" : "Notification");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
diff --git a/protocols/Xfire/src/SHA1.cpp b/protocols/Xfire/src/SHA1.cpp
index 49ac7ab1aa..a310dc5dd6 100644
--- a/protocols/Xfire/src/SHA1.cpp
+++ b/protocols/Xfire/src/SHA1.cpp
@@ -229,23 +229,23 @@ void CSHA1::ReportHash(char *szReport, unsigned char uReportType)
if (uReportType == REPORT_HEX)
{
- mir_snprintf(szTemp, SIZEOF(szTemp), "%02X", m_digest[0]);
+ mir_snprintf(szTemp, "%02X", m_digest[0]);
mir_strcat(szReport, szTemp);
for(i = 1; i < 20; i++)
{
- mir_snprintf(szTemp, SIZEOF(szTemp), " %02X", m_digest[i]);
+ mir_snprintf(szTemp, " %02X", m_digest[i]);
mir_strcat(szReport, szTemp);
}
}
else if (uReportType == REPORT_DIGIT)
{
- mir_snprintf(szTemp, SIZEOF(szTemp), "%u", m_digest[0]);
+ mir_snprintf(szTemp, "%u", m_digest[0]);
mir_strcat(szReport, szTemp);
for(i = 1; i < 20; i++)
{
- mir_snprintf(szTemp, SIZEOF(szTemp), " %u", m_digest[i]);
+ mir_snprintf(szTemp, " %u", m_digest[i]);
mir_strcat(szReport, szTemp);
}
}
diff --git a/protocols/Xfire/src/clientloginpacket.cpp b/protocols/Xfire/src/clientloginpacket.cpp
index 75ccf09e2d..59ac46fcdd 100644
--- a/protocols/Xfire/src/clientloginpacket.cpp
+++ b/protocols/Xfire/src/clientloginpacket.cpp
@@ -26,7 +26,7 @@
#include "SHA1.h"
#include <string.h>
#include <iostream>
-#include "baseProtocol.h"
+#include "baseProtocol.h"
namespace xfirelib {
using namespace std;
@@ -112,7 +112,7 @@ void ClientLoginPacket::hashSha1(const char *string, unsigned char *sha){
result[0] = 0;
char szTemp[16];
for(int i = 0 ; i < 20 ; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "%02x", temp[i]);
+ mir_snprintf(szTemp, "%02x", temp[i]);
mir_strcat(result,szTemp);
}
memcpy(sha,result,40);
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp
index 05658e1ac8..ad982108b6 100644
--- a/protocols/Xfire/src/tools.cpp
+++ b/protocols/Xfire/src/tools.cpp
@@ -42,9 +42,9 @@ extern HANDLE hNetlib;
for(int i=0;i<size;i++)
{
if (i%16==0&&i!=0)
- mir_snprintf(buffer, SIZEOF(buffer), "%s\n%02x ", buffer, buf[i]);
+ mir_snprintf(buffer, "%s\n%02x ", buffer, buf[i]);
else
- mir_snprintf(buffer, SIZEOF(buffer), "%s%02x ", buffer, buf[i]);
+ mir_snprintf(buffer, "%s%02x ", buffer, buf[i]);
}
return buffer;
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp
index e80e27feb2..569d9bed08 100644
--- a/protocols/Yahoo/src/util.cpp
+++ b/protocols/Yahoo/src/util.cpp
@@ -188,7 +188,7 @@ extern PLUGININFOEX pluginInfo;
void CYahooProto::YAHOO_utils_logversion()
{
char str[256];
- mir_snprintf(str, SIZEOF(str), "Yahoo v%d.%d.%d.%d", (pluginInfo.version >> 24) & 0xFF, (pluginInfo.version >> 16) & 0xFF,
+ mir_snprintf(str, "Yahoo v%d.%d.%d.%d", (pluginInfo.version >> 24) & 0xFF, (pluginInfo.version >> 16) & 0xFF,
(pluginInfo.version >> 8) & 0xFF, pluginInfo.version & 0xFF);
debugLogA(str);
}
diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h
index 758918768f..97c38e77ae 100644
--- a/protocols/Yahoo/src/yahoo.h
+++ b/protocols/Yahoo/src/yahoo.h
@@ -30,11 +30,8 @@
#include "libyahoo2/yahoo2_callbacks.h"
#include "libyahoo2/yahoo_util.h"
-extern "C"
-{
- #include <newpluginapi.h>
- #include <m_system.h>
-};
+#include <newpluginapi.h>
+#include <m_system.h>
#include <m_system_cpp.h>
#include <m_database.h>
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp
index 4b36e6aa15..5f5246dde4 100644
--- a/src/core/stdaway/src/sendmsg.cpp
+++ b/src/core/stdaway/src/sendmsg.cpp
@@ -75,7 +75,7 @@ static const char *StatusModeToDbSetting(int status, const char *suffix)
case ID_STATUS_IDLE: prefix = "Idl"; break;
default: return NULL;
}
- mir_snprintf(str, SIZEOF(str), "%s%s", prefix, suffix);
+ mir_snprintf(str, "%s%s", prefix, suffix);
return str;
}
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index 8a5536ec24..84b1fc6fb4 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -309,7 +309,7 @@ void AddIcons(void)
HICON LoadIconEx(char* pszIcoLibName, BOOL big)
{
char szTemp[256];
- mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp, big);
}
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp
index b886edf0d5..284499ef98 100644
--- a/src/core/stdchat/src/tools.cpp
+++ b/src/core/stdchat/src/tools.cpp
@@ -28,16 +28,16 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
int i = 8; // MSGFONTID_MESSAGEAREA
if (colour) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dCol", i);
+ mir_snprintf(str, "SRMFont%dCol", i);
*colour = db_get_dw(NULL, "SRMM", str, 0);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSize", i);
+ mir_snprintf(str, "SRMFont%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, "SRMM", str, -12);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSty", i);
+ mir_snprintf(str, "SRMFont%dSty", i);
int style = db_get_b(NULL, "SRMM", str, 0);
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & DBFONTF_ITALIC ? 1 : 0;
@@ -47,7 +47,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "SRMFont%d", i);
+ mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
if (db_get_ts(NULL, "SRMM", str, &dbv))
@@ -56,7 +56,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
+ mir_snprintf(str, "SRMFont%dSet", i);
lf->lfCharSet = db_get_b(NULL, "SRMM", str, DEFAULT_CHARSET);
}
return true;
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp
index 02ae7b298e..873fb00d56 100644
--- a/src/core/stdclist/src/clcfonts.cpp
+++ b/src/core/stdclist/src/clcfonts.cpp
@@ -73,7 +73,7 @@ void RegisterCListFonts()
_tcsncpy(fontid.name, clistFontDescr[i].tszName, SIZEOF(fontid.name));
char idstr[10];
- mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i);
+ mir_snprintf(idstr, "Font%d", i);
strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
fontid.order = i;
FontRegisterT(&fontid);
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp
index 5a755bec3c..50b947abf1 100644
--- a/src/core/stdclist/src/cluiopts.cpp
+++ b/src/core/stdclist/src/cluiopts.cpp
@@ -140,9 +140,9 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_HSCROLL:
{
char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
}
if (wParam != 0x12345678)
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index d49fd5f3db..a092b1449f 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -221,7 +221,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
for (int i = 0; i < MAX_MRU_DIRS; i++) {
char idstr[32];
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
+ mir_snprintf(idstr, "MruDir%d", i);
DBVARIANT dbv;
if (db_get_ts(NULL, "SRFile", idstr, &dbv))
@@ -276,7 +276,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
+ mir_snprintf(buf, "%u", ci.dVal);
break;
}
}
@@ -348,9 +348,9 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
int i;
DBVARIANT dbv;
for (i = MAX_MRU_DIRS-2;i>=0;i--) {
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
+ mir_snprintf(idstr, "MruDir%d", i);
if (db_get_ts(NULL, "SRFile", idstr, &dbv)) continue;
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i+1);
+ mir_snprintf(idstr, "MruDir%d", i+1);
db_set_ts(NULL, "SRFile", idstr, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp
index bb4128b9dd..5516373588 100644
--- a/src/core/stdfile/src/filesenddlg.cpp
+++ b/src/core/stdfile/src/filesenddlg.cpp
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
+ mir_snprintf(buf, "%u", ci.dVal);
break;
}
}
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index f7e1ddeb2a..d2a22249e3 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -59,16 +59,16 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
char str[32];
if (colour) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dCol", i);
+ mir_snprintf(str, "SRMFont%dCol", i);
*colour = db_get_dw(NULL, SRMMMOD, str, fontOptionsList[i].defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSize", i);
+ mir_snprintf(str, "SRMFont%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSty", i);
+ mir_snprintf(str, "SRMFont%dSty", i);
int style = db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defStyle);
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & DBFONTF_ITALIC ? 1 : 0;
@@ -78,7 +78,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "SRMFont%d", i);
+ mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
if (db_get_ts(NULL, SRMMMOD, str, &dbv))
@@ -87,7 +87,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
+ mir_snprintf(str, "SRMFont%dSet", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, MsgDlgGetFontDefaultCharset(lf->lfFaceName));
}
return true;
@@ -103,7 +103,7 @@ void RegisterSRMMFonts(void)
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
_tcsncpy_s(fontid.group, LPGENT("Message log"), _TRUNCATE);
_tcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE);
- mir_snprintf(idstr, SIZEOF(idstr), "SRMFont%d", i);
+ mir_snprintf(idstr, "SRMFont%d", i);
strncpy_s(fontid.prefix, idstr, _TRUNCATE);
fontid.order = i;
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp
index 301371a4ef..b06a8c795d 100644
--- a/src/core/stduserinfo/src/contactinfo.cpp
+++ b/src/core/stduserinfo/src/contactinfo.cpp
@@ -277,7 +277,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.pszText = TranslateT("Primary");
}
else {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
+ mir_snprintf(idstr, "e-mail%d", i);
if (db_get_ts(hContact, szProto, idstr, &dbv))
break;
@@ -292,7 +292,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iSubItem = 0;
for (i=0;;i++) {
lvi.lParam = i;
- mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
+ mir_snprintf(idstr, "Mye-mail%d", i);
if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -353,7 +353,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iSubItem = 0;
for (i=0;; i++) {
lvi.lParam = i;
- mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
+ mir_snprintf(idstr, "MyPhone%d", i);
if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -464,7 +464,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szNewData))
break;
for (int i=0;; i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
db_free(&dbv);
}
@@ -477,13 +477,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
char idstr[33];
DBVARIANT dbv;
for (i = lvi.lParam;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
+ mir_snprintf(idstr, szIdTemplate, i+1);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
db_set_s(hContact, "UserInfo", idstr, dbv.pszVal);
db_free(&dbv);
}
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
db_unset(hContact, "UserInfo", idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
@@ -491,7 +491,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
//edit
char szText[256], idstr[33];
DBVARIANT dbv;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
+ mir_snprintf(idstr, szIdTemplate, lvi.lParam);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
mir_strncpy(szText, dbv.pszVal, SIZEOF(szText));
db_free(&dbv);
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp
index 3b6e387dd0..197d24440c 100644
--- a/src/core/stduserinfo/src/stdinfo.cpp
+++ b/src/core/stduserinfo/src/stdinfo.cpp
@@ -97,7 +97,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
if (dbv.cVal == -100) unspecified = 1;
else {
pstr = str;
- mir_snprintf(str, SIZEOF(str), dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
+ mir_snprintf(str, dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
}
}
else {
@@ -406,11 +406,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i);
+ mir_snprintf(idstr, "Past%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i);
+ mir_snprintf(idstr, "Past%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
@@ -425,11 +425,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%d", i);
+ mir_snprintf(idstr, "Affiliation%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i);
+ mir_snprintf(idstr, "Affiliation%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
@@ -451,11 +451,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i);
+ mir_snprintf(idstr, "Interest%dCat", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i);
+ mir_snprintf(idstr, "Interest%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index 22e6b3e8df..6fd3aa39af 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -364,6 +364,6 @@ MIR_CORE_DLL(BOOL) db_set_resident(const char *szModule, const char *szService,
return FALSE;
char str[MAXMODULELABELLENGTH * 2];
- mir_snprintf(str, SIZEOF(str), "%s/%s", szModule, szService);
+ mir_snprintf(str, "%s/%s", szModule, szService);
return currDb->SetSettingResident(bEnable, str);
}
diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp
index 92b0580ffa..806f17d775 100644
--- a/src/mir_core/src/icons.cpp
+++ b/src/mir_core/src/icons.cpp
@@ -39,7 +39,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
if (prefix) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%s", prefix, pIcons[i].szName);
+ mir_snprintf(szSetting, "%s_%s", prefix, pIcons[i].szName);
sid.pszName = szSetting;
}
else sid.pszName = pIcons[i].szName;
@@ -64,7 +64,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconI
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
if (prefix) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%s", prefix, pIcons[i].szName);
+ mir_snprintf(szSetting, "%s_%s", prefix, pIcons[i].szName);
sid.pszName = szSetting;
}
else sid.pszName = pIcons[i].szName;
diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp
index 520f19b5a4..cd2b25e94d 100644
--- a/src/mir_core/src/path.cpp
+++ b/src/mir_core/src/path.cpp
@@ -77,7 +77,7 @@ MIR_CORE_DLL(int) PathToAbsolute(const char *pSrc, char *pOut, const char *base)
if (pSrc[0] == '\\')
pSrc++;
- mir_snprintf(buf, SIZEOF(buf), "%s%s", base, pSrc);
+ mir_snprintf(buf, "%s%s", base, pSrc);
return GetFullPathNameA(buf, SIZEOF(buf), pOut, NULL);
}
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index 5a2497b21a..dd889280c2 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -97,28 +97,28 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
FontOptionsList &FO = fontOptionsList[i];
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = db_get_dw(NULL, CHATFONT_MODULE, str, FO.defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, CHATFONT_MODULE, str, FO.defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
+ mir_snprintf(str, "Font%dSty", i);
style = db_get_b(NULL, CHATFONT_MODULE, str, FO.defStyle);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, CHATFONT_MODULE, str, FO.defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%d", i);
+ mir_snprintf(str, "Font%d", i);
ptrT tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
@@ -185,7 +185,7 @@ void RegisterFonts(void)
HICON LoadIconEx(char* pszIcoLibName, BOOL big)
{
char szTemp[256];
- mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp, big);
}
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 9fc6d5b20a..59c37ff1c1 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -159,7 +159,7 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
col = _ttoi(szTemp3);
col += (OPTIONS_FONTCOUNT + 1);
- mir_snprintf(szTemp, SIZEOF(szTemp), (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
+ mir_snprintf(szTemp, (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
break;
case 'C':
@@ -167,23 +167,23 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
if (!g_Settings->bStripFormat && !streamData->bStripFormat) {
int j = streamData->lin->bIsHighlighted ? 16 : EventToIndex(streamData->lin);
if (*line == 'C')
- mir_snprintf(szTemp, SIZEOF(szTemp), "\\cf%u ", j + 1);
+ mir_snprintf(szTemp, "\\cf%u ", j + 1);
else
- mir_snprintf(szTemp, SIZEOF(szTemp), "\\highlight0 ");
+ mir_snprintf(szTemp, "\\highlight0 ");
}
break;
case 'b':
case 'u':
case 'i':
if (!streamData->bStripFormat)
- mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'u') ? "\\%cl " : "\\%c ", *line);
+ mir_snprintf(szTemp, (*line == 'u') ? "\\%cl " : "\\%c ", *line);
break;
case 'B':
case 'U':
case 'I':
if (!streamData->bStripFormat) {
- mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'U') ? "\\%cl0 " : "\\%c0 ", *line);
+ mir_snprintf(szTemp, (*line == 'U') ? "\\%cl0 " : "\\%c0 ", *line);
CharLowerA(szTemp);
}
break;
@@ -191,7 +191,7 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
case 'r':
if (!streamData->bStripFormat) {
int index = EventToIndex(streamData->lin);
- mir_snprintf(szTemp, SIZEOF(szTemp), "%s ", Log_SetStyle(index));
+ mir_snprintf(szTemp, "%s ", Log_SetStyle(index));
}
break;
}
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index 1eddd43662..74207f06e8 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -688,18 +688,18 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
cli.pfnGetDefaultFontSetting(i, lf, colour);
char idstr[20];
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
+ mir_snprintf(idstr, "Font%dName", i);
ptrT tszFace(db_get_tsa(NULL, "CLC", idstr));
if (tszFace)
mir_tstrcpy(lf->lfFaceName, tszFace);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
+ mir_snprintf(idstr, "Font%dCol", i);
*colour = db_get_dw(NULL, "CLC", idstr, *colour);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
+ mir_snprintf(idstr, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, "CLC", idstr, lf->lfHeight);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
+ mir_snprintf(idstr, "Font%dSty", i);
BYTE style = (BYTE)db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
@@ -707,7 +707,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
+ mir_snprintf(idstr, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index f63a86d5c0..b81968aee8 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -283,12 +283,12 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
PMO_IntMenuItem menuHandle = MO_AddNewMenuItem(hContactMenuObject, &tmi);
char buf[256];
if (mi->pszService)
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
+ mir_snprintf(buf, "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
else if (mi->ptszName) {
if (tmi.flags & CMIF_UNICODE)
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
+ mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
else
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
+ mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}
else buf[0] = '\0';
if (buf[0]) MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
@@ -426,7 +426,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
XStatus = 0;
char buf[255];
- mir_snprintf(buf, SIZEOF(buf), "*XStatus%d", XStatus);
+ mir_snprintf(buf, "*XStatus%d", XStatus);
bool check = wildcmp(smep->svc, buf) != 0;
bool reset = wildcmp(smep->svc, "*XStatus0") != 0;
@@ -902,7 +902,7 @@ void RebuildMenuOrder(void)
cli.menuProtoCount++;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "RootProtocolIcon_%s", pa->szModuleName);
+ mir_snprintf(buf, "RootProtocolIcon_%s", pa->szModuleName);
MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
DestroyIcon(ic);
@@ -936,7 +936,7 @@ void RebuildMenuOrder(void)
hStatusMenuHandles[i].menuhandle[j] = MO_AddNewMenuItem(hStatusMenuObject, &tmi);
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMenuHandles[i].menuhandle[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
@@ -982,7 +982,7 @@ void RebuildMenuOrder(void)
}
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
@@ -1206,7 +1206,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
char buf[MAX_PATH + 64];
char *p = (pRoot) ? mir_t2a(pRoot->mi.ptszName) : NULL;
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
+ mir_snprintf(buf, "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
mir_free(p);
MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp
index 497527bc8d..9995bf219b 100644
--- a/src/modules/clist/contacts.cpp
+++ b/src/modules/clist/contacts.cpp
@@ -350,7 +350,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam)
int offset = tzi->Bias + tzi->StandardBias;
char str[80];
- mir_snprintf(str, SIZEOF(str), offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
+ mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
ci->pszVal = ci->dwFlag & CNF_UNICODE ? (TCHAR*)mir_a2u(str) : (TCHAR*)mir_strdup(str);
ci->type = CNFT_ASCIIZ;
return 0;
@@ -384,7 +384,7 @@ public:
m_nameOrder(this, IDC_NAMEORDER)
{
m_nameOrder.SetFlags(MTREE_DND);
- m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
+ m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
}
virtual void OnInitDialog()
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index 7a2339ed47..6be6805ab2 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -170,7 +170,7 @@ class CGenMenuOptionsPage : public CDlgBase
GetMenuItemName(p, menuItemName, sizeof(menuItemName));
{
DBVARIANT dbv;
- mir_snprintf(buf, SIZEOF(buf), "%s_name", menuItemName);
+ mir_snprintf(buf, "%s_name", menuItemName);
if (!db_get_ts(NULL, MenuNameItems, buf, &dbv)) {
PD->name = mir_tstrdup(dbv.ptszVal);
@@ -182,11 +182,11 @@ class CGenMenuOptionsPage : public CDlgBase
PD->pimi = p;
PD->defname = mir_tstrdup(GetMenuItemText(p));
- mir_snprintf(buf, SIZEOF(buf), "%s_visible", menuItemName);
+ mir_snprintf(buf, "%s_visible", menuItemName);
PD->bShow = db_get_b(NULL, MenuNameItems, buf, 1) != 0;
if (bReread) {
- mir_snprintf(buf, SIZEOF(buf), "%s_pos", menuItemName);
+ mir_snprintf(buf, "%s_pos", menuItemName);
PD->pos = db_get_dw(NULL, MenuNameItems, buf, 1);
}
else PD->pos = (PD->pimi) ? PD->pimi->originalPosition : 0;
@@ -323,7 +323,7 @@ public:
int iNewMenuValue = !m_radio1.GetState();
if (iNewMenuValue != iInitMenuValue) {
- db_set_b(NULL, "CList", "MoveProtoMenus", iNewMenuValue);
+ db_set_b(NULL, "CList", "MoveProtoMenus", iNewMenuValue);
RebuildProtoMenus(iNewMenuValue);
iInitMenuValue = iNewMenuValue;
@@ -362,7 +362,7 @@ public:
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
m_menuItems.InsertItem(&tvis);
- NotifyChange();
+ NotifyChange();
}
void btnReset_Clicked(CCtrlButton*)
@@ -370,7 +370,7 @@ public:
int MenuObjectID;
if (GetCurrentMenuObjectID(MenuObjectID)) {
BuildTree(MenuObjectID, false);
- NotifyChange();
+ NotifyChange();
}
}
@@ -393,7 +393,7 @@ public:
SaveTree();
RebuildCurrent();
- NotifyChange();
+ NotifyChange();
}
void btnSet_Clicked(CCtrlButton*)
@@ -415,7 +415,7 @@ public:
SaveTree();
RebuildCurrent();
- NotifyChange();
+ NotifyChange();
}
void onMenuObjectChanged(void*)
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index 90ac2c35b2..4df022e512 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -133,16 +133,16 @@ static void LoadGroups(LIST<ExtraIconGroup> &groups)
int count = db_get_w(NULL, MODULE_NAME "Groups", "Count", 0);
for (int i=0; i < count; i++) {
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%d_count", i);
+ mir_snprintf(setting, "%d_count", i);
unsigned int items = db_get_w(NULL, MODULE_NAME "Groups", setting, 0);
if (items < 1)
continue;
- mir_snprintf(setting, SIZEOF(setting), "__group_%d", i);
+ mir_snprintf(setting, "__group_%d", i);
ExtraIconGroup *group = new ExtraIconGroup(setting);
for (unsigned int j = 0; j < items; j++) {
- mir_snprintf(setting, SIZEOF(setting), "%d_%d", i, j);
+ mir_snprintf(setting, "%d_%d", i, j);
ptrA szIconName(db_get_sa(NULL, MODULE_NAME "Groups", setting));
if (IsEmpty(szIconName))
continue;
@@ -408,10 +408,10 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam)
}
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "Position_%s", ei->name);
+ mir_snprintf(setting, "Position_%s", ei->name);
extra->setPosition(db_get_w(NULL, MODULE_NAME, setting, 1000));
- mir_snprintf(setting, SIZEOF(setting), "Slot_%s", ei->name);
+ mir_snprintf(setting, "Slot_%s", ei->name);
int slot = db_get_w(NULL, MODULE_NAME, setting, 1);
if (slot == (WORD)-1)
slot = -1;
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp
index 2b51b9e718..28d0bf553d 100644
--- a/src/modules/extraicons/options_ei.cpp
+++ b/src/modules/extraicons/options_ei.cpp
@@ -342,7 +342,7 @@ public:
}
else {
char name[128];
- mir_snprintf(name, SIZEOF(name), "__group_%d", groups.getCount());
+ mir_snprintf(name, "__group_%d", groups.getCount());
ExtraIconGroup *group = new ExtraIconGroup(name);
@@ -365,10 +365,10 @@ public:
BaseExtraIcon *extra = registeredExtraIcons[i];
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "Position_%s", extra->getName());
+ mir_snprintf(setting, "Position_%s", extra->getName());
db_set_w(NULL, MODULE_NAME, setting, extra->getPosition());
- mir_snprintf(setting, SIZEOF(setting), "Slot_%s", extra->getName());
+ mir_snprintf(setting, "Slot_%s", extra->getName());
db_set_w(NULL, MODULE_NAME, setting, extra->getSlot());
}
@@ -378,13 +378,13 @@ public:
ExtraIconGroup *group = groups[k];
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%d_count", k);
+ mir_snprintf(setting, "%d_count", k);
db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.getCount());
for (int j = 0; j < group->items.getCount(); j++) {
BaseExtraIcon *extra = group->items[j];
- mir_snprintf(setting, SIZEOF(setting), "%d_%d", k, j);
+ mir_snprintf(setting, "%d_%d", k, j);
db_set_s(NULL, MODULE_NAME "Groups", setting, extra->getName());
}
}
@@ -419,10 +419,10 @@ public:
ImageList_Destroy(m_tree.GetImageList(TVSIL_NORMAL));
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (msg == WM_NOTIFY) {
- LPNMHDR lpnmhdr = (LPNMHDR)lParam;
+ virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ {
+ if (msg == WM_NOTIFY) {
+ LPNMHDR lpnmhdr = (LPNMHDR)lParam;
if (lpnmhdr->idFrom == IDC_EXTRAORDER && lpnmhdr->code == NM_RCLICK) {
HTREEITEM hSelected = m_tree.GetDropHilight();
if (hSelected != NULL && !m_tree.IsSelected(hSelected)) {
@@ -450,8 +450,8 @@ public:
}
}
- return CDlgBase::DlgProc(msg, wParam, lParam);
- }
+ return CDlgBase::DlgProc(msg, wParam, lParam);
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index 9ab089c02b..f1b149740c 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -45,9 +45,9 @@ void SaveColumnSizes(HWND hwndResults)
ListView_GetColumnOrderArray(hwndResults, columnCount, columnOrder);
for (int i = 0; i < NUM_COLUMNID; i++) {
char szSetting[32];
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
+ mir_snprintf(szSetting, "ColOrder%d", i);
db_set_b(NULL, "FindAdd", szSetting, (BYTE)columnOrder[i]);
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
+ mir_snprintf(szSetting, "ColWidth%d", i);
db_set_w(NULL, "FindAdd", szSetting, (WORD)ListView_GetColumnWidth(hwndResults, i));
}
db_set_b(NULL, "FindAdd", "SortColumn", (BYTE)dat->iLastColumnSortIndex);
@@ -84,14 +84,14 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto)
else lvc.pszText = _T("ID");
}
else lvc.mask &= ~LVCF_TEXT;
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
+ mir_snprintf(szSetting, "ColWidth%d", i);
lvc.cx = db_get_w(NULL, "FindAdd", szSetting, defaultColumnSizes[i]);
ListView_InsertColumn(hwndResults, i, (LPARAM)&lvc);
if (bNeedsFree)
mir_free(lvc.pszText);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
+ mir_snprintf(szSetting, "ColOrder%d", i);
columnOrder[i] = db_get_b(NULL, "FindAdd", szSetting, -1);
if (columnOrder[i] == -1 || columnOrder[i] >= NUM_COLUMNID)
colOrdersValid = false;
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 6efdc67f7d..a028f0d9cc 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -147,7 +147,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte
for (int i = 0; i < flist.getCount(); i++) {
FontInternal& F = flist[i];
- mir_snprintf(buff, SIZEOF(buff), "\n[%s]", F.dbSettingsGroup);
+ mir_snprintf(buff, "\n[%s]", F.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
strncpy(header, buff, SIZEOF(header));
WriteLine(out, buff);
@@ -193,7 +193,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte
for (int i = 0; i < clist.getCount(); i++) {
ColourInternal& C = clist[i];
- mir_snprintf(buff, SIZEOF(buff), "\n[%s]", C.dbSettingsGroup);
+ mir_snprintf(buff, "\n[%s]", C.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
strncpy_s(header, buff, _TRUNCATE);
WriteLine(out, buff);
@@ -205,7 +205,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte
for (int i = 0; i < elist.getCount(); i++) {
EffectInternal& E = elist[i];
- mir_snprintf(buff, SIZEOF(buff), "\n[%s]", E.dbSettingsGroup);
+ mir_snprintf(buff, "\n[%s]", E.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
strncpy_s(header, buff, _TRUNCATE);
WriteLine(out, buff);
@@ -504,7 +504,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
char str[128];
if (F.flags & FIDF_APPENDNAME)
- mir_snprintf(str, SIZEOF(str), "%sName", F.prefix);
+ mir_snprintf(str, "%sName", F.prefix);
else
strncpy_s(str, F.prefix, _TRUNCATE);
@@ -514,7 +514,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
db_set_s(NULL, F.dbSettingsGroup, str, buff);
}
- mir_snprintf(str, SIZEOF(str), "%sSize", F.prefix);
+ mir_snprintf(str, "%sSize", F.prefix);
if (F.flags & FIDF_SAVEACTUALHEIGHT) {
SIZE size;
CreateFromFontSettings(&F.value, &lf);
@@ -535,17 +535,17 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
}
else db_set_b(NULL, F.dbSettingsGroup, str, F.value.size);
- mir_snprintf(str, SIZEOF(str), "%sSty", F.prefix);
+ mir_snprintf(str, "%sSty", F.prefix);
db_set_b(NULL, F.dbSettingsGroup, str, F.value.style);
- mir_snprintf(str, SIZEOF(str), "%sSet", F.prefix);
+ mir_snprintf(str, "%sSet", F.prefix);
db_set_b(NULL, F.dbSettingsGroup, str, F.value.charset);
- mir_snprintf(str, SIZEOF(str), "%sCol", F.prefix);
+ mir_snprintf(str, "%sCol", F.prefix);
db_set_dw(NULL, F.dbSettingsGroup, str, F.value.colour);
if (F.flags & FIDF_NOAS) {
- mir_snprintf(str, SIZEOF(str), "%sAs", F.prefix);
+ mir_snprintf(str, "%sAs", F.prefix);
db_set_w(NULL, F.dbSettingsGroup, str, (WORD)0x00FF);
}
- mir_snprintf(str, SIZEOF(str), "%sFlags", F.prefix);
+ mir_snprintf(str, "%sFlags", F.prefix);
db_set_w(NULL, F.dbSettingsGroup, str, (WORD)F.flags);
}
@@ -1139,13 +1139,13 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
for (i = 0; i < effect_id_list_w2.getCount(); i++) {
EffectInternal& E = effect_id_list_w2[i];
- mir_snprintf(str, SIZEOF(str), "%sEffect", E.setting);
+ mir_snprintf(str, "%sEffect", E.setting);
db_set_b(NULL, E.dbSettingsGroup, str, E.value.effectIndex);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol1", E.setting);
+ mir_snprintf(str, "%sEffectCol1", E.setting);
db_set_dw(NULL, E.dbSettingsGroup, str, E.value.baseColour);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol2", E.setting);
+ mir_snprintf(str, "%sEffectCol2", E.setting);
db_set_dw(NULL, E.dbSettingsGroup, str, E.value.secondaryColour);
}
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index b02a4f7c82..77f29e8218 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -137,7 +137,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
char idstr[256];
if (flags & FIDF_APPENDNAME)
- mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
+ mir_snprintf(idstr, "%sName", prefix);
else
strncpy_s(idstr, prefix, _TRUNCATE);
@@ -149,14 +149,14 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
retval = 1;
if (colour) {
- mir_snprintf(idstr, SIZEOF(idstr), "%sCol", prefix);
+ mir_snprintf(idstr, "%sCol", prefix);
*colour = db_get_dw(NULL, settings_group, idstr, *colour);
}
- mir_snprintf(idstr, SIZEOF(idstr), "%sSize", prefix);
+ mir_snprintf(idstr, "%sSize", prefix);
lf->lfHeight = (char)db_get_b(NULL, settings_group, idstr, lf->lfHeight);
- mir_snprintf(idstr, SIZEOF(idstr), "%sSty", prefix);
+ mir_snprintf(idstr, "%sSty", prefix);
BYTE style = (BYTE)db_get_b(NULL, settings_group, idstr,
(lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0) | lf->lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
@@ -166,7 +166,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = (style & DBFONTF_STRIKEOUT) != 0;
- mir_snprintf(idstr, SIZEOF(idstr), "%sSet", prefix);
+ mir_snprintf(idstr, "%sSet", prefix);
lf->lfCharSet = db_get_b(NULL, settings_group, idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
@@ -250,7 +250,7 @@ static int sttRegisterFontWorker(FontIDW *font_id, int hLangpack)
}
char idstr[256];
- mir_snprintf(idstr, SIZEOF(idstr), "%sFlags", font_id->prefix);
+ mir_snprintf(idstr, "%sFlags", font_id->prefix);
db_set_dw(0, font_id->dbSettingsGroup, idstr, font_id->flags);
FontInternal* newItem = new FontInternal;
@@ -413,13 +413,13 @@ void KillModuleColours(int hLangpack)
void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT *effectsettings)
{
char str[256];
- mir_snprintf(str, SIZEOF(str), "%sEffect", effect_id->setting);
+ mir_snprintf(str, "%sEffect", effect_id->setting);
effectsettings->effectIndex = db_get_b(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.effectIndex);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol1", effect_id->setting);
+ mir_snprintf(str, "%sEffectCol1", effect_id->setting);
effectsettings->baseColour = db_get_dw(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.baseColour);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol2", effect_id->setting);
+ mir_snprintf(str, "%sEffectCol2", effect_id->setting);
effectsettings->secondaryColour = db_get_dw(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.secondaryColour);
}
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp
index 9f17f423f5..e2a78aff38 100644
--- a/src/modules/metacontacts/meta_menu.cpp
+++ b/src/modules/metacontacts/meta_menu.cpp
@@ -111,25 +111,25 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI
// remove the last one
int id = ccMeta->nSubs - 1;
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "Handle%d", id);
+ mir_snprintf(buffer, "Handle%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Protocol%d", id);
+ mir_snprintf(buffer, "Protocol%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d", id);
+ mir_snprintf(buffer, "Status%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "StatusString%d", id);
+ mir_snprintf(buffer, "StatusString%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Login%d", id);
+ mir_snprintf(buffer, "Login%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", id);
+ mir_snprintf(buffer, "Nick%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", id);
+ mir_snprintf(buffer, "CListName%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
if (ccSub != NULL) {
@@ -425,7 +425,7 @@ void InitMenus()
mi.pszName = "";
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "MetaContacts/MenuFunc%d", i);
+ mir_snprintf(buffer, "MetaContacts/MenuFunc%d", i);
mi.pszService = buffer;
mi.position++;
hMenuContact[i] = Menu_AddContactMenuItem(&mi);
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index 7a7ef09b80..72f60c5f71 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -374,12 +374,12 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
}
else if (!mir_strcmp(dcws->szSetting, "Nick") && dcws->value.type != DBVT_DELETED) {
// subcontact nick has changed - update metacontact
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", contact_number);
+ mir_snprintf(buffer, "Nick%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
ptrT tszMyhandle(db_get_tsa(hContact, "CList", "MyHandle"));
if (tszMyhandle == NULL) {
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number);
+ mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
}
@@ -402,7 +402,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
else if (!mir_strcmp(dcws->szModule, "CList") && !mir_strcmp(dcws->szSetting, "MyHandle")) {
if (dcws->value.type == DBVT_DELETED) {
char *proto = GetContactProto(hContact);
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number);
+ mir_snprintf(buffer, "CListName%d", contact_number);
DBVARIANT dbv;
if (proto && !db_get_ts(hContact, proto, "Nick", &dbv)) {
@@ -413,7 +413,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
}
else {
// subcontact clist displayname has changed - update metacontact
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number);
+ mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
}
@@ -423,10 +423,10 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
// subcontact changing status
else if (!mir_strcmp(dcws->szSetting, "Status") && dcws->value.type != DBVT_DELETED) {
// update subcontact status setting
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d", contact_number);
+ mir_snprintf(buffer, "Status%d", contact_number);
db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
- mir_snprintf(buffer, SIZEOF(buffer), "StatusString%d", contact_number);
+ mir_snprintf(buffer, "StatusString%d", contact_number);
db_set_ts(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
// set status to that of most online contact
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp
index 9bf3aff72e..e58f509fcf 100644
--- a/src/modules/metacontacts/meta_utils.cpp
+++ b/src/modules/metacontacts/meta_utils.cpp
@@ -116,7 +116,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
// write the contact's protocol
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "Protocol%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Protocol%d", ccDest->nSubs);
if (db_set_s(hMeta, META_PROTO, buffer, szProto)) {
MessageBox(0, TranslateT("Could not write contact protocol to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -124,7 +124,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
}
// write the login
- mir_snprintf(buffer, SIZEOF(buffer), "Login%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Login%d", ccDest->nSubs);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
MessageBox(0, TranslateT("Could not write unique ID of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -136,7 +136,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
// If we can get the nickname of the subcontact...
if (!db_get(hSub, szProto, "Nick", &dbv)) {
// write the nickname
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Nick%d", ccDest->nSubs);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
MessageBox(0, TranslateT("Could not write nickname of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -147,22 +147,22 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
}
// write the display name
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", ccDest->nSubs);
+ mir_snprintf(buffer, "CListName%d", ccDest->nSubs);
db_set_ts(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
// Get the status
WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
// write the status
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Status%d", ccDest->nSubs);
db_set_w(hMeta, META_PROTO, buffer, status);
// write the handle
- mir_snprintf(buffer, SIZEOF(buffer), "Handle%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Handle%d", ccDest->nSubs);
db_set_dw(hMeta, META_PROTO, buffer, hSub);
// write status string
- mir_snprintf(buffer, SIZEOF(buffer), "StatusString%d", ccDest->nSubs);
+ mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
TCHAR *szStatus = cli.pfnGetStatusModeDescription(status, 0);
db_set_ts(hMeta, META_PROTO, buffer, szStatus);
@@ -362,7 +362,7 @@ int Meta_HideLinkedContacts(void)
continue;
// update metacontact's record of status for this contact
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d",contact_number);
+ mir_snprintf(buffer, "Status%d",contact_number);
// prepare to update metacontact record of subcontat status
char *szProto = GetContactProto(hContact);
@@ -372,10 +372,10 @@ int Meta_HideLinkedContacts(void)
// update metacontact's record of nick for this contact
if (szProto && !db_get(hContact, szProto, "Nick", &dbv)) {
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d",contact_number);
+ mir_snprintf(buffer, "Nick%d",contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dbv);
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d",contact_number);
+ mir_snprintf(buffer, "CListName%d",contact_number);
if (db_get(hContact, "CList", "MyHandle", &dbv2))
db_set(ccMeta->contactID, META_PROTO, buffer, &dbv);
else {
@@ -387,7 +387,7 @@ int Meta_HideLinkedContacts(void)
}
else {
if (!db_get(hContact, "CList", "MyHandle", &dbv)) {
- mir_snprintf(buffer, SIZEOF(buffer),"CListName%d",contact_number);
+ mir_snprintf(buffer,"CListName%d",contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dbv);
db_free(&dbv);
}
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp
index ddc74b7a6b..f0b8464a2f 100644
--- a/src/modules/netlib/netlibautoproxy.cpp
+++ b/src/modules/netlib/netlibautoproxy.cpp
@@ -169,11 +169,11 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps)
if ((nlc->nloc.flags & (NLOCF_HTTP | NLOCF_HTTPGATEWAY) && nlc->nloc.flags & NLOCF_SSL) ||
nlc->nloc.wPort == 443 || forceHttps)
{
- mir_snprintf(szUrl, SIZEOF(szUrl), "https://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, "https://%s", nlc->nloc.szHost);
usingSsl = true;
}
else if (nlc->nloc.flags & (NLOCF_HTTPGATEWAY | NLOCF_HTTP) || nlc->usingHttpGateway)
- mir_snprintf(szUrl, SIZEOF(szUrl), "http://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, "http://%s", nlc->nloc.szHost);
else
{
strncpy_s(szUrl, nlc->nloc.szHost, _TRUNCATE);
diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp
index 0770977c16..892554542d 100644
--- a/src/modules/netlib/netlibhttpproxy.cpp
+++ b/src/modules/netlib/netlibhttpproxy.cpp
@@ -88,7 +88,7 @@ static bool NetlibHttpGatewaySend(NetlibConnection *nlc, RequestType reqType, co
nlhrSend.timeout = -1;
if ((nlc->nlhpi.flags & NLHPIF_USEGETSEQUENCE) && (nlc->nlhpi.szHttpGetUrl != NULL)) {
mir_cslock lck(nlc->csHttpSequenceNums);
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s%u", nlc->nlhpi.szHttpGetUrl, nlc->nlhpi.firstGetSequence++);
+ mir_snprintf(szUrl, "%s%u", nlc->nlhpi.szHttpGetUrl, nlc->nlhpi.firstGetSequence++);
if (nlc->nlhpi.flags & NLHPIF_GETPOSTSAMESEQUENCE)
nlc->nlhpi.firstPostSequence++;
nlhrSend.szUrl = szUrl;
@@ -99,7 +99,7 @@ static bool NetlibHttpGatewaySend(NetlibConnection *nlc, RequestType reqType, co
case reqOldPost:
nlhrSend.requestType = REQUEST_POST;
if ((nlc->nlhpi.flags & NLHPIF_USEPOSTSEQUENCE) && (nlc->nlhpi.szHttpPostUrl != NULL)) {
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s%u", nlc->nlhpi.szHttpPostUrl, nlc->nlhpi.firstPostSequence);
+ mir_snprintf(szUrl, "%s%u", nlc->nlhpi.szHttpPostUrl, nlc->nlhpi.firstPostSequence);
nlhrSend.szUrl = szUrl;
}
else nlhrSend.szUrl = nlc->nlhpi.szHttpPostUrl;
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp
index 7b9a892782..894899be2f 100644
--- a/src/modules/netlib/netlibopenconn.cpp
+++ b/src/modules/netlib/netlibopenconn.cpp
@@ -302,11 +302,11 @@ static bool NetlibInitHttpsConnection(NetlibConnection *nlc, NetlibUser *nlu, NE
nlhrSend.requestType = REQUEST_CONNECT;
nlhrSend.flags = NLHRF_GENERATEHOST | NLHRF_DUMPPROXY | NLHRF_SMARTAUTHHEADER | NLHRF_HTTP11 | NLHRF_NOPROXY | NLHRF_REDIRECT;
if (nlc->dnsThroughProxy)
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s:%u", nloc->szHost, nloc->wPort);
+ mir_snprintf(szUrl, "%s:%u", nloc->szHost, nloc->wPort);
else {
DWORD ip = DnsLookup(nlu, nloc->szHost);
if (ip == 0) return false;
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s:%u", inet_ntoa(*(PIN_ADDR)&ip), nloc->wPort);
+ mir_snprintf(szUrl, "%s:%u", inet_ntoa(*(PIN_ADDR)&ip), nloc->wPort);
}
nlhrSend.szUrl = szUrl;
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index 2e3445126f..d3f30498d6 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -517,7 +517,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl)
strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
- mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
+ mir_snprintf(szTemp, search_device, szDev);
txtParseParam(szData, szTemp, "<controlURL>", "</controlURL>", szUrl, sizeUrl);
// URL combining per RFC 2396
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 8b52feb368..0c668e50d2 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -212,7 +212,7 @@ static void SaveOptionsTreeState(HWND hdlg)
tvi.hItem = TreeView_GetRoot(GetDlgItem(hdlg, IDC_PAGETREE));
while (tvi.hItem != NULL) {
if (SendDlgItemMessageA(hdlg, IDC_PAGETREE, TVM_GETITEMA, 0, (LPARAM)&tvi)) {
- mir_snprintf(buf, SIZEOF(buf), "%s%s", OPTSTATE_PREFIX, str);
+ mir_snprintf(buf, "%s%s", OPTSTATE_PREFIX, str);
db_set_b(NULL, "Options", buf, (BYTE)((tvi.state & TVIS_EXPANDED) ? 1 : 0));
}
tvi.hItem = TreeView_GetNextSibling(GetDlgItem(hdlg, IDC_PAGETREE), tvi.hItem);
@@ -656,7 +656,7 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat)
while (tvi.hItem != NULL) {
if (SendMessageA(hwndTree, TVM_GETITEMA, 0, (LPARAM)&tvi)) {
char buf[130];
- mir_snprintf(buf, SIZEOF(buf), "%s%s", OPTSTATE_PREFIX, str);
+ mir_snprintf(buf, "%s%s", OPTSTATE_PREFIX, str);
if (!db_get_b(NULL, "Options", buf, 1))
TreeView_Expand(hwndTree, tvi.hItem, TVE_COLLAPSE);
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 42e27aba15..1e92cb637c 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -294,7 +294,7 @@ int LoadAccountsModule(void)
static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
{
char tmp[100];
- mir_snprintf(tmp, SIZEOF(tmp), "%s%s", szModule, szService);
+ mir_snprintf(tmp, "%s%s", szModule, szService);
return CreateServiceFunctionObj(tmp, pFunc, param);
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 0b54d8e30c..c276a62ca1 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -74,7 +74,7 @@ PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBasePr
char buf[100];
int count = 1;
while (true) {
- mir_snprintf(buf, SIZEOF(buf), "%s_%d", szBaseProto, count++);
+ mir_snprintf(buf, "%s_%d", szBaseProto, count++);
if (ptrA(db_get_sa(NULL, buf, "AM_BaseProto")) == NULL)
break;
}
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp
index 4c04405e09..4e86d5021b 100644
--- a/src/modules/skin/hotkey_opts.cpp
+++ b/src/modules/skin/hotkey_opts.cpp
@@ -307,7 +307,7 @@ static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lP
static void sttOptionsAddHotkey(HWND hwndList, THotkeyItem *item)
{
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "mir_hotkey_%d_%d", g_pid, g_hkid++);
+ mir_snprintf(buf, "mir_hotkey_%d_%d", g_pid, g_hkid++);
THotkeyItem *newItem = (THotkeyItem *)mir_alloc(sizeof(THotkeyItem));
newItem->pszName = NULL;
@@ -369,7 +369,7 @@ static void sttOptionsSaveItem(THotkeyItem *item)
subItem->Hotkey = subItem->OptHotkey;
subItem->type = subItem->OptType;
- mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, item->nSubHotkeys);
+ mir_snprintf(buf, "%s$%d", item->pszName, item->nSubHotkeys);
db_set_w(NULL, DBMODULENAME, buf, subItem->Hotkey);
if (subItem->type != HKT_MANUAL)
db_set_b(NULL, DBMODULENAME "Types", buf, (BYTE)subItem->type);
@@ -377,7 +377,7 @@ static void sttOptionsSaveItem(THotkeyItem *item)
++item->nSubHotkeys;
} }
- mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
+ mir_snprintf(buf, "%s$count", item->pszName);
db_set_dw(NULL, DBMODULENAME, buf, item->nSubHotkeys);
}
@@ -664,7 +664,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_CONTEXTMENU:
if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_LV_HOTKEYS) {
HWND hwndList = (HWND)wParam;
- POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
LVITEM lvi = {0};
THotkeyItem *item = NULL;
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index 13dfc09ad0..d660ef294a 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -178,7 +178,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
item->lParam = desc->lParam;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "mir_hotkey_%d_%d", g_pid, g_hkid++);
+ mir_snprintf(buf, "mir_hotkey_%d_%d", g_pid, g_hkid++);
item->idHotkey = GlobalAddAtomA(buf);
if (item->type == HKT_GLOBAL) {
if (item->Enabled) {
@@ -192,10 +192,10 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
if (!item->rootHotkey) {
/* try to load alternatives from db */
int count, i;
- mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
+ mir_snprintf(buf, "%s$count", item->pszName);
count = (int)db_get_dw(NULL, DBMODULENAME, buf, -1);
for (i=0; i < count; i++) {
- mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, i);
+ mir_snprintf(buf, "%s$%d", item->pszName, i);
if (!db_get_w(NULL, DBMODULENAME, buf, 0))
continue;
@@ -371,7 +371,7 @@ int LoadSkinHotkeys(void)
for (int i=0; i < SIZEOF(oldSettings); i++) {
char szSetting[ 100 ];
- mir_snprintf(szSetting, SIZEOF(szSetting), "HK%s", oldSettings[i]);
+ mir_snprintf(szSetting, "HK%s", oldSettings[i]);
WORD key;
if ((key = db_get_w(NULL, "Clist", szSetting, 0))) {
@@ -379,7 +379,7 @@ int LoadSkinHotkeys(void)
db_set_w(NULL, DBMODULENAME, newSettings[i], key);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "HKEn%s", oldSettings[i]);
+ mir_snprintf(szSetting, "HKEn%s", oldSettings[i]);
if ((key = db_get_b(NULL, "Clist", szSetting, 0))) {
db_unset(NULL, "Clist", szSetting);
db_set_b(NULL, DBMODULENAME "Off", newSettings[i], (BYTE)(key == 0));
diff --git a/src/modules/utils/enterstring.cpp b/src/modules/utils/enterstring.cpp
index 156945d14f..84adf3a1e4 100644
--- a/src/modules/utils/enterstring.cpp
+++ b/src/modules/utils/enterstring.cpp
@@ -56,7 +56,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm)
{
for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, i);
+ mir_snprintf(setting, "%s%d", pForm->szDataPrefix, i);
ptrT tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
@@ -82,7 +82,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm)
id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, id);
+ mir_snprintf(setting, "%s%d", pForm->szDataPrefix, id);
db_set_ts(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}