summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/client.cpp2
-rw-r--r--protocols/AimOscar/src/proto.cpp4
-rw-r--r--protocols/AimOscar/src/server.cpp14
-rw-r--r--protocols/AimOscar/src/theme.cpp18
-rw-r--r--protocols/AimOscar/src/utility.cpp12
-rw-r--r--protocols/FacebookRM/src/proto.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/icolib.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp2
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp4
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp12
-rw-r--r--protocols/IcqOscarJ/src/UI/userinfotab.cpp4
-rw-r--r--protocols/IcqOscarJ/src/changeinfo/editstring.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_menu.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp10
-rw-r--r--protocols/IcqOscarJ/src/log.cpp2
-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.cpp4
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp16
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp6
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp6
-rw-r--r--protocols/JabberG/src/jabber_std.cpp6
-rw-r--r--protocols/JabberG/src/jabber_util.cpp4
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
-rw-r--r--protocols/MSN/src/msn_auth.cpp2
-rw-r--r--protocols/MSN/src/msn_commands.cpp32
-rw-r--r--protocols/MSN/src/msn_contact.cpp6
-rw-r--r--protocols/MSN/src/msn_ftold.cpp12
-rw-r--r--protocols/MSN/src/msn_lists.cpp20
-rw-r--r--protocols/MSN/src/msn_mail.cpp2
-rw-r--r--protocols/MSN/src/msn_menu.cpp4
-rw-r--r--protocols/MSN/src/msn_misc.cpp24
-rw-r--r--protocols/MSN/src/msn_opts.cpp8
-rw-r--r--protocols/MSN/src/msn_p2p.cpp8
-rw-r--r--protocols/MSN/src/msn_proto.cpp4
-rw-r--r--protocols/MSN/src/msn_soapab.cpp22
-rw-r--r--protocols/MSN/src/msn_soapstore.cpp12
-rw-r--r--protocols/Omegle/src/communication.cpp8
-rw-r--r--protocols/Sametime/src/conference.cpp4
-rw-r--r--protocols/Sametime/src/sametime.cpp4
-rw-r--r--protocols/Sametime/src/sametime_session.cpp2
-rw-r--r--protocols/SkypeClassic/src/skype.cpp10
-rw-r--r--protocols/SkypeClassic/src/skypeapi.cpp4
-rw-r--r--protocols/SkypeClassic/src/skypeopt.cpp4
-rw-r--r--protocols/Tlen/src/tlen.cpp2
-rw-r--r--protocols/Tlen/src/tlen_file.cpp8
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp12
-rw-r--r--protocols/Tlen/src/tlen_muc.cpp10
-rw-r--r--protocols/Tlen/src/tlen_p2p_new.cpp4
-rw-r--r--protocols/Tlen/src/tlen_p2p_old.cpp11
-rw-r--r--protocols/Tlen/src/tlen_picture.cpp16
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp2
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp6
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp6
-rw-r--r--protocols/Twitter/src/ui.cpp14
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp30
-rw-r--r--protocols/Yahoo/src/chat.cpp4
-rw-r--r--protocols/Yahoo/src/icolib.cpp4
-rw-r--r--protocols/Yahoo/src/services.cpp8
-rw-r--r--protocols/Yahoo/src/util.cpp2
-rw-r--r--protocols/Yahoo/src/yahoo.cpp16
72 files changed, 280 insertions, 277 deletions
diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp
index 8c725810a5..69577e8cc2 100644
--- a/protocols/AimOscar/src/client.cpp
+++ b/protocols/AimOscar/src/client.cpp
@@ -53,7 +53,7 @@ int CAimProto::aim_auth_request(HANDLE hServerConn,unsigned short &seqno,const c
char client_id[64], mirver[64];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirver), (LPARAM)mirver);
- int client_id_len = mir_snprintf(client_id, sizeof(client_id), "Miranda AIM, version %s", mirver);
+ int client_id_len = mir_snprintf(client_id, SIZEOF(client_id), "Miranda AIM, version %s", mirver);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*14+MD5_HASH_LENGTH+strlen(username)+client_id_len+30+strlen(language)+strlen(country));
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 6bf94c926c..ec60663c33 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -57,7 +57,7 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) :
m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2P[128];
- mir_snprintf(szP2P, sizeof(szP2P), "%sP2P", m_szModuleName);
+ mir_snprintf(szP2P, SIZEOF(szP2P), "%sP2P", m_szModuleName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s Client-to-client connection"), m_tszUserName);
nlu.szSettingsModule = szP2P;
@@ -824,7 +824,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
case EV_PROTO_ONERASE:
{
char szDbsettings[64];
- mir_snprintf(szDbsettings, sizeof(szDbsettings), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbsettings, SIZEOF(szDbsettings), "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
}
break;
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp
index c2b74f219d..743966c18a 100644
--- a/protocols/AimOscar/src/server.cpp
+++ b/protocols/AimOscar/src/server.cpp
@@ -316,7 +316,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
char f =cap[13];
char g =cap[14];
char h =cap[15];
- mir_snprintf(client,sizeof(client),CLIENT_OSCARJ,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e));
+ mir_snprintf(client,SIZEOF(client),CLIENT_OSCARJ,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e));
}
else if (memcmp(cap, "MirandaA", 8) == 0)
{
@@ -328,7 +328,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
char f =cap[13];
char g =cap[14];
char h =cap[15];
- mir_snprintf(client,sizeof(client),CLIENT_AIMOSCAR,a,b,c,d,e,f,g,h);
+ mir_snprintf(client,SIZEOF(client),CLIENT_AIMOSCAR,a,b,c,d,e,f,g,h);
}
if (memcmp(cap, "sinj", 4) == 0)
{
@@ -340,7 +340,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
char f =cap[9];
char g =cap[10];
char h =cap[11];
- mir_snprintf(client,sizeof(client),CLIENT_OSCARSN,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
+ mir_snprintf(client,SIZEOF(client),CLIENT_OSCARSN,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
}
if (memcmp(cap, "icqp", 4) == 0)
{
@@ -352,7 +352,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
char f =cap[9];
char g =cap[10];
char h =cap[11];
- mir_snprintf(client,sizeof(client),CLIENT_OSCARPL,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
+ mir_snprintf(client,SIZEOF(client),CLIENT_OSCARPL,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
}
else if (memcmp(cap, "Kopete ICQ", 10) == 0)
{
@@ -1588,7 +1588,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013
default:
char msg[64];
- mir_snprintf(msg, sizeof(msg), "Error removing buddy from list. Error code %#x", code);
+ mir_snprintf(msg, SIZEOF(msg), "Error removing buddy from list. Error code %#x", code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1623,7 +1623,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013
default:
char msg[64];
- mir_snprintf(msg, sizeof(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code);
+ mir_snprintf(msg, SIZEOF(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1643,7 +1643,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013
default:
char msg[64];
- mir_snprintf(msg, sizeof(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
+ mir_snprintf(msg, SIZEOF(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index baacf678f0..0e4b6b69b5 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -63,7 +63,7 @@ void InitIcons(void)
HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "AIM_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AIM_%s", name);
return Skin_GetIcon(szSettingName, big);
}
@@ -79,7 +79,7 @@ HANDLE GetIconHandle(const char* name)
void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName ), "%s_%s", "AIM", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName ), "%s_%s", "AIM", name);
Skin_ReleaseIcon(szSettingName, big);
}
@@ -245,21 +245,21 @@ void CAimProto::InitMainMenus(void)
mi.hParentMenu = hRoot;
mi.flags = CMIF_CHILDPOPUP;
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/ManageAccount");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/ManageAccount");
CreateProtoService("/ManageAccount", &CAimProto::ManageAccount);
mi.position = 201001;
mi.icolibItem = GetIconHandle("aim");
mi.pszName = LPGEN("Manage Account");
hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/InstantIdle");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/InstantIdle");
CreateProtoService("/InstantIdle",&CAimProto::InstantIdle);
mi.position = 201002;
mi.icolibItem = GetIconHandle("idle");
mi.pszName = LPGEN("Instant Idle");
hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CAimProto::JoinChatUI);
mi.position = 201003;
mi.icolibItem = GetIconHandle("aol");
@@ -276,7 +276,7 @@ void CAimProto::InitContactMenus(void)
mi.pszService = service_name;
mi.pszContactOwner = m_szModuleName;
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetHTMLAwayMsg");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/GetHTMLAwayMsg");
CreateProtoService("/GetHTMLAwayMsg",&CAimProto::GetHTMLAwayMsg);
mi.position = -2000006000;
mi.icolibItem = GetIconHandle("away");
@@ -284,7 +284,7 @@ void CAimProto::InitContactMenus(void)
mi.flags = CMIF_NOTOFFLINE | CMIF_HIDDEN;
hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetProfile");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/GetProfile");
CreateProtoService("/GetProfile", &CAimProto::GetProfile);
mi.position = -2000005090;
mi.icolibItem = GetIconHandle("profile");
@@ -292,7 +292,7 @@ void CAimProto::InitContactMenus(void)
mi.flags = CMIF_NOTOFFLINE;
hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
mi.position = -2000005080;
mi.icolibItem = GetIconHandle("add");
@@ -300,7 +300,7 @@ void CAimProto::InitContactMenus(void)
mi.flags = CMIF_NOTONLINE | CMIF_HIDDEN;
hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/BlockCommand");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/BlockCommand");
CreateProtoService("/BlockCommand", &CAimProto::BlockBuddy);
mi.position = -2000005060;
mi.icolibItem = GetIconHandle("block");
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp
index 28678182a4..dfd9677ca3 100644
--- a/protocols/AimOscar/src/utility.cpp
+++ b/protocols/AimOscar/src/utility.cpp
@@ -498,42 +498,42 @@ void BdList::remove_by_id(unsigned short id)
unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_BI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_BI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_BI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_BI"%d", i);
return delSetting(hContact, item);
}
unsigned short CAimProto::getGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_GI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_GI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_GI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_GI"%d", i);
return delSetting(hContact, item);
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 21ca57a4a1..9cd807d96c 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -496,7 +496,7 @@ int FacebookProto::OnToolbarInit(WPARAM, LPARAM)
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
char service[100];
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, "/Mind");
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, "/Mind");
ttb.pszService = service;
ttb.pszTooltipUp = ttb.name = LPGEN("Share status...");
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 0514783678..52a988e025 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1009,7 +1009,7 @@ retry:
{
CLISTEVENT cle = {0};
char service[128];
- mir_snprintf(service, sizeof(service), GGS_RECVIMAGE, m_szModuleName);
+ mir_snprintf(service, SIZEOF(service), GGS_RECVIMAGE, m_szModuleName);
cle.cbSize = sizeof(cle);
cle.hContact = hContact;
@@ -1721,7 +1721,7 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, in
{
char sversion[48];
setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD) version);
- mir_snprintf(sversion, sizeof(sversion), "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
+ mir_snprintf(sversion, SIZEOF(sversion), "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
setString(hContact, "MirVer", sversion);
}
}
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index a7fd0a3fa9..95c9902def 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -244,7 +244,7 @@ INT_PTR GGPROTO::blockuser(WPARAM hContact, LPARAM lParam)
void GGPROTO::block_init()
{
char service[64];
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_BLOCKUSER);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_BLOCKUSER);
CreateProtoService(GGS_BLOCKUSER, &GGPROTO::blockuser);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 6c1abc6c9c..0d80f7aef8 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -64,7 +64,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot)
mi.hParentMenu = hRoot;
// Conferencing
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_OPEN_CONF);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_OPEN_CONF);
CreateProtoService(GGS_OPEN_CONF, &GGPROTO::gc_openconf);
mi.position = 2000050001;
mi.icolibItem = iconList[14].hIcolib;
@@ -73,7 +73,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot)
hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
// Clear ignored conferences
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_CLEAR_IGNORED);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_CLEAR_IGNORED);
CreateProtoService(GGS_CLEAR_IGNORED, &GGPROTO::gc_clearignored);
mi.position = 2000050002;
mi.icolibItem = iconList[15].hIcolib;
diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp
index 91d10ae542..b50d305a5d 100644
--- a/protocols/Gadu-Gadu/src/icolib.cpp
+++ b/protocols/Gadu-Gadu/src/icolib.cpp
@@ -51,7 +51,7 @@ void gg_icolib_init()
HICON LoadIconEx(const char* name, BOOL big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", GGDEF_PROTO, name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", GGDEF_PROTO, name);
return Skin_GetIcon(szSettingName, big);
}
@@ -66,7 +66,7 @@ HANDLE GetIconHandle(int iconId)
void ReleaseIconEx(const char* name, BOOL big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", GGDEF_PROTO, name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", GGDEF_PROTO, name);
Skin_ReleaseIcon(szSettingName, big);
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 60d588e888..213e24b51e 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -69,7 +69,7 @@ int gg_img_remove(GGIMAGEDLGDATA *dat);
int GGPROTO::img_init()
{
char service[64];
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_SENDIMAGE);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_SENDIMAGE);
CreateProtoService(GGS_SENDIMAGE, &GGPROTO::img_sendimg);
// Send image contact menu item
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index 27c7830354..c39509f68a 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -514,7 +514,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
{
// Import from server item
char service[64];
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_IMPORT_SERVER);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_IMPORT_SERVER);
CreateProtoService(GGS_IMPORT_SERVER, &GGPROTO::import_server);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -527,7 +527,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
// Import from textfile
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_IMPORT_TEXT);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_IMPORT_TEXT);
CreateProtoService(GGS_IMPORT_TEXT, &GGPROTO::import_text);
mi.position = 2000500002;
@@ -537,7 +537,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
hMainMenu[3] = Menu_AddProtoMenuItem(&mi);
// Remove from server
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_REMOVE_SERVER);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_REMOVE_SERVER);
CreateProtoService(GGS_REMOVE_SERVER, &GGPROTO::remove_server);
mi.position = 2000500003;
@@ -547,7 +547,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
hMainMenu[4] = Menu_AddProtoMenuItem(&mi);
// Export to server
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_EXPORT_SERVER);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_EXPORT_SERVER);
CreateProtoService(GGS_EXPORT_SERVER, &GGPROTO::export_server);
mi.position = 2005000001;
@@ -557,7 +557,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
hMainMenu[5] = Menu_AddProtoMenuItem(&mi);
// Export to textfile
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_EXPORT_TEXT);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_EXPORT_TEXT);
CreateProtoService(GGS_EXPORT_TEXT, &GGPROTO::export_text);
mi.position = 2005000002;
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index 4918700cc8..8b0f8f4a57 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -222,7 +222,7 @@ int oauth_sign_request(LIST<OAUTHPARAMETER> &params, const char *httpmethod, con
char *oauth_generate_nonce()
{
char timestamp[22], randnum[16];
- mir_snprintf(timestamp, sizeof(timestamp), "%ld", time(NULL));
+ mir_snprintf(timestamp, SIZEOF(timestamp), "%ld", time(NULL));
CallService(MS_UTILS_GETRANDOM, (WPARAM)sizeof(randnum), (LPARAM)randnum);
int strSizeB = int(strlen(timestamp) + sizeof(randnum));
@@ -252,7 +252,7 @@ char *oauth_auth_header(const char *httpmethod, const char *url, OAUTHSIGNMETHOD
case RSASHA1: oauth_setparam(oauth_parameters, "oauth_signature_method", "RSA-SHA1"); break;
default: oauth_setparam(oauth_parameters, "oauth_signature_method", "PLAINTEXT"); break;
};
- mir_snprintf(timestamp, sizeof(timestamp), "%ld", time(NULL));
+ mir_snprintf(timestamp, SIZEOF(timestamp), "%ld", time(NULL));
oauth_setparam(oauth_parameters, "oauth_timestamp", timestamp);
nonce = oauth_generate_nonce();
oauth_setparam(oauth_parameters, "oauth_nonce", nonce);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 693c8f6b70..411730e68d 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -426,7 +426,7 @@ BOOL GGPROTO::sessions_closedlg()
void GGPROTO::sessions_menus_init(HGENMENU hRoot)
{
char service[64];
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_CONCUR_SESS);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, GGS_CONCUR_SESS);
CreateProtoService(GGS_CONCUR_SESS, &GGPROTO::sessions_view);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index a4b9913dc1..3dd962a4a3 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 = (HANDLE)"dccchat";
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadIconEx(IDI_DCC);
- mir_snprintf(szService, sizeof(szService), "%s/DblClickEvent", m_szModuleName);
+ mir_snprintf(szService, SIZEOF(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/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 4c5236b898..d70529a159 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -246,9 +246,9 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di)
IN_ADDR in;
memcpy(&in, myhost->h_addr, 4);
if (ipr->iType == IP_AUTO)
- mir_snprintf(m_myHost, sizeof(m_myHost), "%s", inet_ntoa(in));
+ mir_snprintf(m_myHost, SIZEOF(m_myHost), "%s", inet_ntoa(in));
else
- mir_snprintf(m_mySpecifiedHostIP, sizeof(m_mySpecifiedHostIP), "%s", inet_ntoa(in));
+ mir_snprintf(m_mySpecifiedHostIP, SIZEOF(m_mySpecifiedHostIP), "%s", inet_ntoa(in));
}
}
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index dfacc49281..a050bcba34 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -192,7 +192,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
char szTemp2[256];
- mir_snprintf(szTemp2, sizeof(szTemp2), "%s DCC", m_szModuleName);
+ mir_snprintf(szTemp2, SIZEOF(szTemp2), "%s DCC", m_szModuleName);
nlu.szSettingsModule = szTemp2;
mir_sntprintf(name, SIZEOF(name), TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.ptszDescriptiveName = name;
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index ce0aaec509..85097b5146 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -399,7 +399,7 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto>
pData->m_name = m_server.GetTextA();
char temp[255];
- mir_snprintf(temp, sizeof(temp), "%s: %s", pData->m_group, pData->m_name);
+ mir_snprintf(temp, SIZEOF(temp), "%s: %s", pData->m_group, pData->m_name);
mir_free(pData->m_name);
pData->m_name = mir_strdup(temp);
@@ -781,9 +781,9 @@ void CConnectPrefsDlg::OnApply()
char TextLine[512];
if (pData->m_iSSL > 0)
- mir_snprintf(TextLine, sizeof(TextLine), "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, SIZEOF(TextLine), "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
else
- mir_snprintf(TextLine, sizeof(TextLine), "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, SIZEOF(TextLine), "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
db_set_s(NULL, SERVERSMODULE, pData->m_name, TextLine);
// combobox might contain new items
@@ -1375,7 +1375,7 @@ void CIrcProto::InitIgnore(void)
int idx = 0;
char settingName[40];
for (;;) {
- mir_snprintf(settingName, sizeof(settingName), "IGNORE:%d", idx++);
+ mir_snprintf(settingName, SIZEOF(settingName), "IGNORE:%d", idx++);
DBVARIANT dbv;
if (getTString(settingName, &dbv))
@@ -1395,13 +1395,13 @@ void CIrcProto::RewriteIgnoreSettings(void)
int i = 0;
for (;;) {
- mir_snprintf(settingName, sizeof(settingName), "IGNORE:%d", i++);
+ mir_snprintf(settingName, SIZEOF(settingName), "IGNORE:%d", i++);
if (db_unset(NULL, m_szModuleName, settingName))
break;
}
for (i = 0; i < m_ignoreItems.getCount(); i++) {
- mir_snprintf(settingName, sizeof(settingName), "IGNORE:%d", i);
+ mir_snprintf(settingName, SIZEOF(settingName), "IGNORE:%d", i);
CIrcIgnoreItem& C = m_ignoreItems[i];
setTString(settingName, (C.mask + _T(" ") + C.flags + _T(" ") + C.network).c_str());
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
index ee0c1da434..3dbdbdbd2f 100644
--- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp
+++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
@@ -115,11 +115,11 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac
if (!mir_strlen(pXName)) { // give default name
pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]);
}
- mir_snprintf(str, sizeof(str), "%s (%s)", pszStatus, pXName);
+ mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName);
SAFE_FREE((void**)&pXName);
}
else
- mir_snprintf(str, sizeof(str), pszStatus);
+ mir_snprintf(str, SIZEOF(str), "%s", pszStatus);
bUtf = 1;
SAFE_FREE(&pszStatus);
diff --git a/protocols/IcqOscarJ/src/changeinfo/editstring.cpp b/protocols/IcqOscarJ/src/changeinfo/editstring.cpp
index 528f73eaea..22ffcd6f23 100644
--- a/protocols/IcqOscarJ/src/changeinfo/editstring.cpp
+++ b/protocols/IcqOscarJ/src/changeinfo/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, SIZEOF(str), "%d", sid.value);
}
else if (sid.value) {
szValue = BinaryToEscapes((char*)sid.value);
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp
index 0aebb2a2c7..916bbfb503 100644
--- a/protocols/IcqOscarJ/src/icq_menu.cpp
+++ b/protocols/IcqOscarJ/src/icq_menu.cpp
@@ -177,7 +177,7 @@ INT_PTR CIcqProto::OpenWebProfile(WPARAM hContact, LPARAM lParam)
{
DWORD dwUin = getContactUin(hContact);
char url[256];
- mir_snprintf(url, sizeof(url), "http://www.icq.com/people/%d",dwUin);
+ mir_snprintf(url, SIZEOF(url), "http://www.icq.com/people/%d",dwUin);
return CallService(MS_UTILS_OPENURL, 1, (LPARAM)url);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 158f76ffc6..746987b17e 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -1968,11 +1968,11 @@ int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
case EV_PROTO_ONERASE:
{
char szDbSetting[MAX_PATH];
- mir_snprintf(szDbSetting, sizeof(szDbSetting), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbSetting, SIZEOF(szDbSetting), "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- mir_snprintf(szDbSetting, sizeof(szDbSetting), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, SIZEOF(szDbSetting), "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- mir_snprintf(szDbSetting, sizeof(szDbSetting), "%sGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, SIZEOF(szDbSetting), "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
}
break;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index fef0ede1c6..bb3c7d7a46 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -702,7 +702,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, SIZEOF(str), format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):"");
SetWindowTextUtf(hwndDlg, str);
SAFE_FREE(&format);
}
@@ -714,7 +714,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
break;
}
- mir_snprintf(str,sizeof(str),dat->okButtonFormat,dat->countdown);
+ mir_snprintf(str,SIZEOF(str),dat->okButtonFormat,dat->countdown);
SetDlgItemTextUtf(hwndDlg,IDOK,str);
dat->countdown--;
break;
@@ -854,7 +854,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
if (m_bHideXStatusUI || m_bHideXStatusMenu)
return;
- mir_snprintf(szItem, sizeof(szItem), Translate("%s Custom Status"), m_szModuleName);
+ mir_snprintf(szItem, SIZEOF(szItem), Translate("%s Custom Status"), m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszPopupName = szItem;
@@ -862,7 +862,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
mi.position = 2000040000;
for (int i = 0; i <= XSTATUS_COUNT; i++) {
- mir_snprintf(srvFce, sizeof(srvFce), "%s/menuXStatus%d", m_szModuleName, i);
+ mir_snprintf(srvFce, SIZEOF(srvFce), "%s/menuXStatus%d", m_szModuleName, i);
mi.position++;
@@ -894,7 +894,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, SIZEOF(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 52d53a85c4..9a51c88ea5 100644
--- a/protocols/IcqOscarJ/src/log.cpp
+++ b/protocols/IcqOscarJ/src/log.cpp
@@ -126,7 +126,7 @@ void CIcqProto::icq_LogUsingErrorCode(int level, DWORD dwError, const char *szMs
break;
}
- mir_snprintf(szBuf, sizeof(szBuf), "%s%s%s (%s %d)",
+ mir_snprintf(szBuf, SIZEOF(szBuf), "%s%s%s (%s %d)",
szMsg ? ICQTranslateUtfStatic(szMsg, str, 1024) : "",
szMsg ? "\r\n\r\n" : "",
ICQTranslateUtfStatic(pszErrorMsg, szErrorMsg, 512),
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 4a2c08e023..11aae68660 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -180,7 +180,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, SIZEOF(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 73e75d5faf..66b60174bc 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, SIZEOF(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, SIZEOF(setting), "discoWnd_favJID_%d", i);
ptrT dbvJid( getTStringA(setting));
- mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", i);
ptrT dbvNode( getTStringA(setting));
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid, dbvNode, tszName);
SendBothRequests(pNode, NULL);
@@ -801,7 +801,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, SIZEOF(setting), "discoWnd_favName_%d", i);
ptrT tszName( m_proto->getTStringA(setting));
if (tszName != NULL) {
HMENU hSubMenu = CreatePopupMenu();
@@ -835,11 +835,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, SIZEOF(setting), "discoWnd_favName_%d", res);
m_proto->delSetting(setting);
- mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", res);
+ mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", res);
m_proto->delSetting(setting);
- mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", res);
+ mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", res);
m_proto->delSetting(setting);
}
else {
@@ -849,11 +849,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, SIZEOF(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, SIZEOF(setting), "discoWnd_favNode_%d", res);
dbv = m_proto->getTStringA(setting);
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv);
@@ -864,11 +864,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, SIZEOF(setting), "discoWnd_favName_%d", i);
m_proto->delSetting(setting);
- mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", i);
m_proto->delSetting(setting);
- mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", i);
m_proto->delSetting(setting);
}
m_proto->delSetting("discoWnd_favCount");
@@ -1342,11 +1342,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, SIZEOF(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, SIZEOF(setting), "discoWnd_favJID_%d", count);
setTString(setting, pNode->GetJid());
- mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", count);
+ mir_snprintf(setting, SIZEOF(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 511825a65b..f22ea22984 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -294,7 +294,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
myAddr = (char*)CallService(MS_NETLIB_ADDRESSTOSTRING, 1, nlb.dwExternalIP);
char szAddr[256];
- mir_snprintf(szAddr, sizeof(szAddr), "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
+ mir_snprintf(szAddr, SIZEOF(szAddr), "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
mir_free(pFileName);
@@ -410,7 +410,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer,
}
char fileBuffer[2048];
- int bytes = mir_snprintf(fileBuffer, sizeof(fileBuffer), "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size);
+ int bytes = mir_snprintf(fileBuffer, SIZEOF(fileBuffer), "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size);
WsSend(s, fileBuffer, bytes, MSG_DUMPASTEXT);
ft->std.flags |= PFTS_SENDING;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 93b65fc94e..3bdb6ee215 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, SIZEOF(setting), "rcMuc_%d_server", iRecent);
server = ppro->getTStringA(setting);
- mir_snprintf(setting, sizeof(setting), "rcMuc_%d_room", iRecent);
+ mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_room", iRecent);
room = ppro->getTStringA(setting);
- mir_snprintf(setting, sizeof(setting), "rcMuc_%d_nick", iRecent);
+ mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_nick", iRecent);
nick = ppro->getTStringA(setting);
- mir_snprintf(setting, sizeof(setting), "password_rcMuc_%d", iRecent);
+ mir_snprintf(setting, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(setting), "password_rcMuc_%d", iRecent);
if (password)
ppro->setTString(setting, password);
else
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 939ecb82a3..af074cc60c 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -278,8 +278,8 @@ static HICON LoadTransportIcon(char *filename,int i,char *IconName,TCHAR *SectNa
GetModuleFileNameA(NULL, szPath, MAX_PATH);
str=strrchr(szPath,'\\');
if (str != NULL) *str=0;
- mir_snprintf(szMyPath, sizeof(szMyPath), "%s\\Icons\\%s", szPath, filename);
- mir_snprintf(szFullPath, sizeof(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
+ mir_snprintf(szMyPath, SIZEOF(szMyPath), "%s\\Icons\\%s", szPath, filename);
+ mir_snprintf(szFullPath, SIZEOF(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
BOOL nf;
HICON hi=ExtractIconFromPath(szFullPath,&nf);
if (hi) has_proto_icon=TRUE;
@@ -558,7 +558,7 @@ HANDLE g_GetIconHandle(int iconId)
HICON g_LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", GLOBAL_SETTING_PREFIX, name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", GLOBAL_SETTING_PREFIX, name);
return Skin_GetIcon(szSettingName, big);
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 4685104f4e..bf2837a9d0 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -742,7 +742,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams)
{
CLISTEVENT cle = {0};
char szService[256];
- mir_snprintf(szService, sizeof(szService), "%s%s", m_szModuleName, JS_HTTP_AUTH);
+ mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, JS_HTTP_AUTH);
cle.cbSize = sizeof(CLISTEVENT);
cle.hIcon = (HICON) LoadIconEx("openid");
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR;
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 9b7798da0a..90a7c70353 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -775,7 +775,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, SIZEOF(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 b5a39e768d..de6a62609b 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -286,7 +286,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge)
mir_sha1_finish(&ctx, storedKey);
char authmsg[4096];
- int authmsgLen = mir_snprintf(authmsg, sizeof(authmsg), "%s,%s,c=biws,r=%s", msg1, chl, snonce);
+ int authmsgLen = mir_snprintf(authmsg, SIZEOF(authmsg), "%s,%s,c=biws,r=%s", msg1, chl, snonce);
BYTE clientSig[MIR_SHA1_HASH_SIZE];
mir_hmac_sha1(clientSig, storedKey, sizeof(storedKey), (BYTE*)authmsg, authmsgLen);
@@ -305,7 +305,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, SIZEOF(buf), "c=biws,r=%s,p=%s", snonce, encproof);
return mir_base64_encode((PBYTE)buf, cbLen);
}
@@ -318,7 +318,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, SIZEOF(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_std.cpp b/protocols/JabberG/src/jabber_std.cpp
index 09284f20b8..6192fe52c0 100644
--- a/protocols/JabberG/src/jabber_std.cpp
+++ b/protocols/JabberG/src/jabber_std.cpp
@@ -72,16 +72,16 @@ void CJabberProto::ConvertPasswords()
for (int i = 0;; i++) {
char varName[100];
- mir_snprintf(varName, sizeof(varName), "rcMuc_%d_server", i);
+ mir_snprintf(varName, SIZEOF(varName), "rcMuc_%d_server", i);
ptrA str(getStringA(NULL, varName));
if (str == NULL)
break;
- mir_snprintf(varName, sizeof(varName), "rcMuc_%d", i);
+ mir_snprintf(varName, SIZEOF(varName), "rcMuc_%d", i);
if ((passw = JSetStringCrypt(m_szModuleName, NULL, varName)) != NULL) {
delSetting(varName);
- mir_snprintf(varName, sizeof(varName), "password_rcMuc_%d", i);
+ mir_snprintf(varName, SIZEOF(varName), "password_rcMuc_%d", i);
setTString(varName, passw);
}
}
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 7416fa20d4..ea9c7a8519 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -859,7 +859,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, SIZEOF(setting), "%s%d", param, i);
ptrT tszRecent(getTStringA(setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, tszRecent);
@@ -883,7 +883,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, SIZEOF(setting), "%s%d", param, id);
setTString(setting, string);
setByte(param, (id + 1) % recentCount);
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 0a460c7cf2..1db43cfae1 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, SIZEOF(buf), "%s:%lu;", inet_ntoa((*((in_addr*)&pmalAddrList->pMailAddress[i].dwAddr))), pmalAddrList->pMailAddress[i].dwPort);
res += buf;
}
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp
index d0b2830664..271a5de5a3 100644
--- a/protocols/MSN/src/msn_auth.cpp
+++ b/protocols/MSN/src/msn_auth.cpp
@@ -249,7 +249,7 @@ int CMsnProto::MSN_GetPassportAuth(void)
}
else if (retVal != 3 && retVal != 7) {
char err[512];
- mir_snprintf(err, sizeof(err), "Unknown Authentication error: %s", szFault);
+ mir_snprintf(err, SIZEOF(err), "Unknown Authentication error: %s", szFault);
MSN_ShowError(err);
}
}
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index 4c5b24369e..7086b0a042 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -161,9 +161,9 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
ThreadData* newThread = new ThreadData;
if (inet_addr(IPAddress) != MyConnection.extIP || !IPAddressInt)
- mir_snprintf(newThread->mServer, sizeof(newThread->mServer), "%s:%s", IPAddress, Port);
+ mir_snprintf(newThread->mServer, SIZEOF(newThread->mServer), "%s:%s", IPAddress, Port);
else
- mir_snprintf(newThread->mServer, sizeof(newThread->mServer), "%s:%u", IPAddressInt, atol(PortXInt) ^ 0x3141);
+ mir_snprintf(newThread->mServer, SIZEOF(newThread->mServer), "%s:%u", IPAddressInt, atol(PortXInt) ^ 0x3141);
newThread->mType = SERVER_FILETRANS;
@@ -195,7 +195,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
Sleep(3000);
char command[1024];
- int nBytes = mir_snprintf(command, sizeof(command),
+ int nBytes = mir_snprintf(command, SIZEOF(command),
"MIME-Version: 1.0\r\n"
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Invitation-Command: ACCEPT\r\n"
@@ -219,7 +219,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
mir_free(tszEmail);
if (MessageBox(NULL, text, TranslateT("MSN Protocol"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- nBytes = mir_snprintf(command, sizeof(command),
+ nBytes = mir_snprintf(command, SIZEOF(command),
"MIME-Version: 1.0\r\n"
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Invitation-Command: ACCEPT\r\n"
@@ -232,7 +232,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
Invcookie, MyConnection.GetMyExtIPStr());
}
else {
- nBytes = mir_snprintf(command, sizeof(command),
+ nBytes = mir_snprintf(command, SIZEOF(command),
"MIME-Version: 1.0\r\n"
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Invitation-Command: CANCEL\r\n"
@@ -245,8 +245,8 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
}
if (IPAddress != NULL && Port == NULL && SessionID != NULL && SessionProtocol == NULL) { // netmeeting receive 2
- char ipaddr[256];
- mir_snprintf(ipaddr, sizeof(ipaddr), "callto://%s", IPAddress);
+ char ipaddr[256];
+ mir_snprintf(ipaddr, SIZEOF(ipaddr), "callto://%s", IPAddress);
ShellExecuteA(NULL, "open", ipaddr, NULL, NULL, SW_SHOW);
}
}
@@ -582,7 +582,7 @@ void CMsnProto::MSN_ProcessYFind(char* buf, size_t len)
const char* szCont = ezxml_attr(cont, "n");
char szEmail[128];
- mir_snprintf(szEmail, sizeof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, SIZEOF(szEmail), "%s@%s", szCont, szDom);
const char *szNetId = ezxml_attr(cont, "t");
if (msnSearchId != NULL) {
@@ -638,7 +638,7 @@ void CMsnProto::MSN_ProcessAdd(char* buf, size_t len)
int netId = atol(ezxml_attr(cont, "t"));
char szEmail[128];
- mir_snprintf(szEmail, sizeof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, SIZEOF(szEmail), "%s@%s", szCont, szDom);
UrlDecode((char*)szNick);
@@ -685,7 +685,7 @@ void CMsnProto::MSN_ProcessRemove(char* buf, size_t len)
int listId = atol(ezxml_attr(cont, "l"));
char szEmail[128];
- mir_snprintf(szEmail, sizeof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, SIZEOF(szEmail), "%s@%s", szCont, szDom);
Lists_Remove(listId, szEmail);
MsnContact* msc = Lists_Get(szEmail);
@@ -798,7 +798,7 @@ void CMsnProto::MSN_ProcessStatusMessage(char* buf, unsigned len, const char* wl
for (unsigned i = 4; i < pCount; i++) {
char part[16];
- size_t lenPart = mir_snprintf(part, sizeof(part), "{%d}", i - 4);
+ size_t lenPart = mir_snprintf(part, SIZEOF(part), "{%d}", i - 4);
if (parts[i][0] == '\0' && unknown != NULL)
parts[i] = unknown;
size_t lenPartsI = strlen(parts[i]);
@@ -892,13 +892,13 @@ void CMsnProto::MSN_ProcessNotificationMessage(char* buf, unsigned len)
const char* acturl = ezxml_attr(xmlact, "url");
if (acturl == NULL || strstr(acturl, "://") == NULL)
- sz += mir_snprintf(fullurl + sz, sizeof(fullurl)-sz, "%s", ezxml_attr(xmlnot, "siteurl"));
+ sz += mir_snprintf((fullurl + sz), (SIZEOF(fullurl) - sz), "%s", ezxml_attr(xmlnot, "siteurl"));
- sz += mir_snprintf(fullurl + sz, sizeof(fullurl)-sz, "%s", acturl);
+ sz += mir_snprintf((fullurl + sz), (SIZEOF(fullurl) - sz), "%s", acturl);
if (sz != 0 && fullurl[sz - 1] != '?')
- sz += mir_snprintf(fullurl + sz, sizeof(fullurl)-sz, "?");
+ sz += mir_snprintf((fullurl + sz), (SIZEOF(fullurl) - sz), "?");
- mir_snprintf(fullurl + sz, sizeof(fullurl)-sz, "notification_id=%s&message_id=%s",
+ mir_snprintf((fullurl + sz), (SIZEOF(fullurl) - sz), "notification_id=%s&message_id=%s",
ezxml_attr(xmlnot, "id"), ezxml_attr(xmlmsg, "id"));
SkinPlaySound(alertsoundname);
@@ -1514,7 +1514,7 @@ remove:
newThread->mType = SERVER_SWITCHBOARD;
newThread->mInitialContactWLID = mir_strdup(data.callerEmail);
MSN_HContactFromEmail(data.callerEmail, data.callerNick, true, true);
- mir_snprintf(newThread->mCookie, sizeof(newThread->mCookie), "%s %d", data.authChallengeInfo, trid);
+ mir_snprintf(newThread->mCookie, SIZEOF(newThread->mCookie), "%s %d", data.authChallengeInfo, trid);
ReleaseSemaphore(newThread->hWaitEvent, MSN_PACKETS_COMBINE, NULL);
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp
index 06f5abe7e5..7f55df3420 100644
--- a/protocols/MSN/src/msn_contact.cpp
+++ b/protocols/MSN/src/msn_contact.cpp
@@ -88,13 +88,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, SIZEOF(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, SIZEOF(buf),
"<ml><d n=\"%s\"><c n=\"%s\" l=\"%d\" t=\"%d\"/></d></ml>",
dom + 1, email, list, netId);
*(char*)dom = '@';
@@ -215,7 +215,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, SIZEOF(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_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp
index 20284d152a..305e6319b7 100644
--- a/protocols/MSN/src/msn_ftold.cpp
+++ b/protocols/MSN/src/msn_ftold.cpp
@@ -150,8 +150,9 @@ int CMsnProto::MSN_HandleMSNFTP(ThreadData *info, char *cmdString)
}
char tCommand[30];
- mir_snprintf(tCommand, sizeof(tCommand), "FIL %i\r\n", info->mMsnFtp->std.totalBytes);
- info->send(tCommand, strlen(tCommand));
+ size_t tCommandLen;
+ tCommandLen = mir_snprintf(tCommand, SIZEOF(tCommand), "FIL %i\r\n", info->mMsnFtp->std.totalBytes);
+ info->send(tCommand, tCommandLen);
break;
case ' REV': //********* VER
@@ -173,8 +174,9 @@ LBL_InvalidCommand:
if (info->mCaller == 0) { //receive
char tCommand[MSN_MAX_EMAIL_LEN + 50];
- mir_snprintf(tCommand, sizeof(tCommand), "USR %s %s\r\n", MyOptions.szEmail, info->mCookie);
- info->send(tCommand, strlen(tCommand));
+ size_t tCommandLen;
+ tCommandLen = mir_snprintf(tCommand, SIZEOF(tCommand), "USR %s %s\r\n", MyOptions.szEmail, info->mCookie);
+ info->send(tCommand, tCommandLen);
}
else if (info->mCaller == 2) { //send
static const char sttCommand[] = "VER MSNFTP\r\n";
@@ -332,7 +334,7 @@ void CMsnProto::msnftp_startFileSend(ThreadData* info, const char* Invcommand, c
hostname[0] = 0;
char command[1024];
- int nBytes = mir_snprintf(command, sizeof(command),
+ int nBytes = mir_snprintf(command, SIZEOF(command),
"MIME-Version: 1.0\r\n"
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Invitation-Command: %s\r\n"
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index b94e572aaa..2bc9a1cf65 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -275,7 +275,7 @@ void CMsnProto::MSN_CreateContList(void)
char cxml[8192];
- size_t sz = mir_snprintf(cxml, sizeof(cxml), "<ml l=\"1\">");
+ size_t sz = mir_snprintf(cxml, SIZEOF(cxml), "<ml l=\"1\">");
{
mir_cslock lck(m_csLists);
@@ -296,42 +296,42 @@ void CMsnProto::MSN_CreateContList(void)
const char *dom = strchr(C.email, '@');
if (dom == NULL && lastds == NULL) {
- if (sz == 0) sz = mir_snprintf(cxml + sz, sizeof(cxml), "<ml l=\"1\">");
+ if (sz == 0) sz = mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "<ml l=\"1\">");
if (newdom) {
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, "<t>");
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "<t>");
newdom = false;
}
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, "<c n=\"%s\" l=\"%d\"/>", C.email, C.list & ~(LIST_RL | LIST_LL));
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "<c n=\"%s\" l=\"%d\"/>", C.email, C.list & ~(LIST_RL | LIST_LL));
used[j] = true;
}
else if (dom != NULL && lastds != NULL && _stricmp(lastds, dom) == 0) {
- if (sz == 0) sz = mir_snprintf(cxml, sizeof(cxml), "<ml l=\"1\">");
+ if (sz == 0) sz = mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "<ml l=\"1\">");
if (newdom) {
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, "<d n=\"%s\">", lastds + 1);
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "<d n=\"%s\">", lastds + 1);
newdom = false;
}
*(char*)dom = 0;
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, "<c n=\"%s\" l=\"%d\" t=\"%d\"/>", C.email, C.list & ~(LIST_RL | LIST_LL), C.netId);
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "<c n=\"%s\" l=\"%d\" t=\"%d\"/>", C.email, C.list & ~(LIST_RL | LIST_LL), C.netId);
*(char*)dom = '@';
used[j] = true;
}
if (used[j] && sz > 7400) {
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, "</%c></ml>", lastds ? 'd' : 't');
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "</%c></ml>", lastds ? 'd' : 't');
msnNsThread->sendPacket("ADL", "%d\r\n%s", sz, cxml);
sz = 0;
newdom = true;
}
}
if (!newdom)
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, lastds ? "</d>" : "</t>");
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), lastds ? "</d>" : "</t>");
}
}
if (sz) {
- sz += mir_snprintf(cxml + sz, sizeof(cxml) - sz, "</ml>");
+ sz += mir_snprintf((cxml + sz), (SIZEOF(cxml) - sz), "</ml>");
msnNsThread->sendPacket("ADL", "%d\r\n%s", sz, cxml);
}
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
index 80f45f1211..3158934d8e 100644
--- a/protocols/MSN/src/msn_mail.cpp
+++ b/protocols/MSN/src/msn_mail.cpp
@@ -318,7 +318,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, SIZEOF(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_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index f4193b4d92..948a5b03e5 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -92,7 +92,7 @@ INT_PTR CMsnProto::MsnViewProfile(WPARAM hContact, LPARAM)
}
char tUrl[256];
- mir_snprintf(tUrl, sizeof(tUrl), "http://cid-%I64X.profiles.live.com", _atoi64(cid));
+ mir_snprintf(tUrl, SIZEOF(tUrl), "http://cid-%I64X.profiles.live.com", _atoi64(cid));
MsnInvokeMyURL(false, tUrl);
return 0;
}
@@ -177,7 +177,7 @@ INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM)
char msg[1024];
- mir_snprintf(msg, sizeof(msg),
+ mir_snprintf(msg, SIZEOF(msg),
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Application-Name: NetMeeting\r\n"
"Application-GUID: {44BBA842-CC51-11CF-AAFA-00AA00B6015C}\r\n"
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index f7cf5cd6b4..74458df7bd 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -155,7 +155,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl)
if (i == 0)
strcpy(szSetting, "Url");
else
- mir_snprintf(szSetting, sizeof(szSetting), "Url%d", i);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "Url%d", i);
pszUrlAttr = ezxml_attr(xmli, szSetting);
if (pszUrlAttr == NULL)
break;
@@ -420,7 +420,7 @@ int ThreadData::sendMessage(int msgType, const char* email, int netId, const cha
char buf[2048];
int off;
- off = mir_snprintf(buf, sizeof(buf), "MIME-Version: 1.0\r\n");
+ off = mir_snprintf(buf, SIZEOF(buf), "MIME-Version: 1.0\r\n");
if ((parFlags & MSG_DISABLE_HDR) == 0) {
char tFontName[100], tFontStyle[3];
@@ -457,10 +457,10 @@ int ThreadData::sendMessage(int msgType, const char* email, int netId, const cha
}
if (parFlags & MSG_OFFLINE)
- off += mir_snprintf(buf + off, sizeof(buf) - off, "Dest-Agent: client\r\n");
+ off += mir_snprintf((buf + off), (SIZEOF(buf) - off), "Dest-Agent: client\r\n");
- off += mir_snprintf(buf + off, sizeof(buf) - off, "Content-Type: text/plain; charset=UTF-8\r\n");
- off += mir_snprintf(buf + off, sizeof(buf) - off, "X-MMS-IM-Format: FN=%s; EF=%s; CO=%x; CS=0; PF=31%s\r\n\r\n",
+ off += mir_snprintf((buf + off), (SIZEOF(buf) - off), "Content-Type: text/plain; charset=UTF-8\r\n");
+ off += mir_snprintf((buf + off), (SIZEOF(buf) - off), "X-MMS-IM-Format: FN=%s; EF=%s; CO=%x; CS=0; PF=31%s\r\n\r\n",
tFontName, tFontStyle, tFontColor, (parFlags & MSG_RTL) ? ";RL=1" : "");
}
@@ -480,7 +480,7 @@ void ThreadData::sendCaps(void)
char mversion[100], capMsg[1000];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mversion), (LPARAM)mversion);
- mir_snprintf(capMsg, sizeof(capMsg),
+ mir_snprintf(capMsg, SIZEOF(capMsg),
"Content-Type: text/x-clientcaps\r\n\r\n"
"Client-Name: Miranda NG %s (MSN v.%s)\r\n",
mversion, __VERSION_STRING_DOTS);
@@ -524,7 +524,7 @@ int ThreadData::sendRawMessage(int msgType, const char* data, int datLen)
void CMsnProto::MSN_SendTyping(ThreadData* info, const char* email, int netId)
{
char tCommand[1024];
- mir_snprintf(tCommand, sizeof(tCommand),
+ mir_snprintf(tCommand, SIZEOF(tCommand),
"Content-Type: text/x-msmsgscontrol\r\n"
"TypingUser: %s\r\n\r\n\r\n", MyOptions.szEmail);
@@ -586,7 +586,7 @@ void CMsnProto::MSN_SendStatusMessage(const char* msg)
size_t sz;
char szMsg[2048];
if (msnCurrentMedia.cbSize == 0) {
- sz = mir_snprintf(szMsg, sizeof(szMsg), "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia><MachineGuid>%s</MachineGuid>"
+ sz = mir_snprintf(szMsg, SIZEOF(szMsg), "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia><MachineGuid>%s</MachineGuid>"
"<DDP></DDP><SignatureSound></SignatureSound><Scene></Scene><ColorScheme></ColorScheme></Data>",
msgEnc, MyOptions.szMachineGuid);
}
@@ -621,7 +621,7 @@ void CMsnProto::MSN_SendStatusMessage(const char* msg)
char *szPlayer = HtmlEncodeUTF8T(msnCurrentMedia.ptszPlayer);
char *szType = HtmlEncodeUTF8T(msnCurrentMedia.ptszType);
- sz = mir_snprintf(szMsg, sizeof szMsg,
+ sz = mir_snprintf(szMsg, SIZEOF(szMsg),
"<Data>"
"<PSM>%s</PSM>"
"<CurrentMedia>%s\\0%s\\01\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0\\0</CurrentMedia>"
@@ -718,7 +718,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus)
char szMsg[256];
if (m_iStatus < ID_STATUS_ONLINE) {
- int sz = mir_snprintf(szMsg, sizeof(szMsg),
+ int sz = mir_snprintf(szMsg, SIZEOF(szMsg),
"<EndpointData><Capabilities>%u:%u</Capabilities></EndpointData>", myFlags, myFlagsEx);
msnNsThread->sendPacket("UUX", "%d\r\n%s", sz, szMsg);
@@ -743,7 +743,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus)
szPlace = mir_utf8encodeT(buf);
}
- int sz = mir_snprintf(szMsg, sizeof(szMsg),
+ int sz = mir_snprintf(szMsg, SIZEOF(szMsg),
"<PrivateEndpointData>"
"<EpName>%s</EpName>"
"<Idle>%s</Idle>"
@@ -1237,7 +1237,7 @@ void MSN_MakeDigest(const char* chl, char* dgst)
md5hash[i] &= 0x7FFFFFFF;
char chlString[128];
- mir_snprintf(chlString, sizeof(chlString), "%s%s00000000", chl, msnProductID);
+ mir_snprintf(chlString, SIZEOF(chlString), "%s%s00000000", chl, msnProductID);
chlString[(strlen(chl) + strlen(msnProductID) + 7) & 0xF8] = 0;
LONGLONG high = 0, low = 0;
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp
index 6003c2c5e5..f0653b83b0 100644
--- a/protocols/MSN/src/msn_opts.cpp
+++ b/protocols/MSN/src/msn_opts.cpp
@@ -53,7 +53,7 @@ void MsnInitIcons(void)
HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "MSN_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "MSN_%s", name);
return Skin_GetIcon(szSettingName, big);
}
@@ -69,7 +69,7 @@ HANDLE GetIconHandle(int iconId)
void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "MSN_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "MSN_%s", name);
Skin_ReleaseIcon(szSettingName, big);
}
@@ -204,7 +204,7 @@ LBL_Continue:
if (strchr(szFile, ' ') != NULL) {
char tmpBuf[MAX_PATH + 2];
- mir_snprintf(tmpBuf, sizeof(tmpBuf), "\"%s\"", szFile);
+ mir_snprintf(tmpBuf, SIZEOF(tmpBuf), "\"%s\"", szFile);
strcpy(szFile, tmpBuf);
}
@@ -329,7 +329,7 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
gethst = 0;
if (gethst == 0)
- mir_snprintf(ipaddr, sizeof(ipaddr), "%s", proto->msnLoggedIn ? proto->MyConnection.GetMyExtIPStr() : "");
+ mir_snprintf(ipaddr, SIZEOF(ipaddr), "%s", proto->msnLoggedIn ? proto->MyConnection.GetMyExtIPStr() : "");
SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_SETCURSEL, gethst, 0);
if (ipaddr[0])
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index f9703ad446..a6cb19e8e0 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -1398,8 +1398,8 @@ void CMsnProto::p2p_startConnect(const char* wlid, const char* szCallID, const c
newThread->mType = SERVER_P2P_DIRECT;
newThread->mInitialContactWLID = mir_strdup(wlid);
- mir_snprintf(newThread->mCookie, sizeof(newThread->mCookie), "%s", szCallID);
- mir_snprintf(newThread->mServer, sizeof(newThread->mServer),
+ mir_snprintf(newThread->mCookie, SIZEOF(newThread->mCookie), "%s", szCallID);
+ mir_snprintf(newThread->mServer, SIZEOF(newThread->mServer),
ipv6 ? "[%s]:%s" : "%s:%s", pAddrTokBeg, pPortTokBeg);
newThread->startThread(&CMsnProto::p2p_fileActiveThread, this);
@@ -1742,7 +1742,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* wl
if (hdrdata.mRemSize || hdrdata.mTFCode == 0) {
char msgid[128];
- mir_snprintf(msgid, sizeof(msgid), "%s_%08x", wlid, hdrdata.mPacketNum);
+ mir_snprintf(msgid, SIZEOF(msgid), "%s_%08x", wlid, hdrdata.mPacketNum);
int idx;
if (hdrdata.mTFCode == 0x01) {
@@ -1833,7 +1833,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wlid
if (hdrdata.mPacketLen < hdrdata.mTotalSize) {
char msgid[128];
- mir_snprintf(msgid, sizeof(msgid), "%s_%08x", wlid, hdrdata.mID);
+ mir_snprintf(msgid, SIZEOF(msgid), "%s_%08x", wlid, hdrdata.mID);
int idx = addCachedMsg(msgid, msgbody, (size_t)hdrdata.mOffset, hdrdata.mPacketLen,
(size_t)hdrdata.mTotalSize, false);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 1442006c20..c4a9461921 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -123,7 +123,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
nlu1.szSettingsModule = szDbsettings;
nlu1.ptszDescriptiveName = szBuffer;
- mir_snprintf(szDbsettings, sizeof(szDbsettings), "%s_HTTPS", m_szModuleName);
+ mir_snprintf(szDbsettings, SIZEOF(szDbsettings), "%s_HTTPS", m_szModuleName);
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin HTTPS connections"), m_tszUserName);
hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
@@ -1081,7 +1081,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
case EV_PROTO_ONERASE:
char szDbsettings[64];
- mir_snprintf(szDbsettings, sizeof(szDbsettings), "%s_HTTPS", m_szModuleName);
+ mir_snprintf(szDbsettings, SIZEOF(szDbsettings), "%s_HTTPS", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
break;
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp
index a3871d4c37..22b92fe25b 100644
--- a/protocols/MSN/src/msn_soapab.cpp
+++ b/protocols/MSN/src/msn_soapab.cpp
@@ -76,8 +76,8 @@ ezxml_t CMsnProto::abSoapHdr(const char* service, const char* scenario, ezxml_t&
ezxml_t CMsnProto::getSoapResponse(ezxml_t bdy, const char* service)
{
char resp1[40], resp2[40];
- mir_snprintf(resp1, sizeof(resp1), "%sResponse", service);
- mir_snprintf(resp2, sizeof(resp2), "%sResult", service);
+ mir_snprintf(resp1, SIZEOF(resp1), "%sResponse", service);
+ mir_snprintf(resp2, SIZEOF(resp2), "%sResult", service);
ezxml_t res = ezxml_get(bdy, "soap:Body", 0, resp1, 0, resp2, -1);
if (res == NULL)
@@ -95,7 +95,7 @@ ezxml_t CMsnProto::getSoapFault(ezxml_t bdy, bool err)
void CMsnProto::UpdateABHost(const char* service, const char* url)
{
char hostname[128];
- mir_snprintf(hostname, sizeof(hostname), "ABHost-%s", service);
+ mir_snprintf(hostname, SIZEOF(hostname), "ABHost-%s", service);
if (url)
setString(hostname, url);
@@ -114,7 +114,7 @@ void CMsnProto::UpdateABCacheKey(ezxml_t bdy, bool isSharing)
char* CMsnProto::GetABHost(const char* service, bool isSharing)
{
char hostname[128];
- mir_snprintf(hostname, sizeof(hostname), "ABHost-%s", service);
+ mir_snprintf(hostname, SIZEOF(hostname), "ABHost-%s", service);
char* host = (char*)mir_alloc(256);
if (db_get_static(NULL, m_szModuleName, hostname, host, 256)) {
@@ -286,7 +286,7 @@ bool CMsnProto::MSN_SharingFindMembership(bool deltas, bool allowRecurse)
else if (strcmp(szType, "Phone") == 0) {
netId = NETID_MOB;
char email[128];
- mir_snprintf(email, sizeof(email), "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
+ mir_snprintf(email, SIZEOF(email), "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
szEmail = email;
}
else if (strcmp(szType, "Email") == 0) {
@@ -403,7 +403,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, SIZEOF(buf), "%02d:", netId);
ezxml_set_txt(node, buf);
}
@@ -637,8 +637,8 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas
}
ezxml_t abinf = ezxml_child(ab, "abInfo");
- mir_snprintf(mycid, sizeof(mycid), "%s", ezxml_txt(ezxml_child(abinf, "OwnerCID")));
- mir_snprintf(mypuid, sizeof(mycid), "%s", ezxml_txt(ezxml_child(abinf, "ownerPuid")));
+ mir_snprintf(mycid, SIZEOF(mycid), "%s", ezxml_txt(ezxml_child(abinf, "OwnerCID")));
+ mir_snprintf(mypuid, SIZEOF(mypuid), "%s", ezxml_txt(ezxml_child(abinf, "ownerPuid")));
if (MyOptions.ManageServer) {
ezxml_t grp = ezxml_get(body, szGroups, 0, "Group", -1);
@@ -688,7 +688,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas
szMsgUsr = ezxml_txt(ezxml_child(phn, "isMessengerEnabled"));
if (strcmp(szMsgUsr, "true") == 0) {
szEmail = ezxml_txt(ezxml_child(phn, "number"));
- mir_snprintf(email, sizeof(email), "tel:%s", szEmail);
+ mir_snprintf(email, SIZEOF(email), "tel:%s", szEmail);
szEmail = email;
netId = NETID_MOB;
break;
@@ -1465,8 +1465,8 @@ void CMsnProto::MSN_ABUpdateDynamicItem(bool allowRecurse)
time(&timer);
tm *tmst = gmtime(&timer);
- char tmstr[32];
- mir_snprintf(tmstr, sizeof(tmstr), "%04u-%02u-%02uT%02u:%02u:%02uZ",
+ char tmstr[64];
+ mir_snprintf(tmstr, SIZEOF(tmstr), "%04u-%02u-%02uT%02u:%02u:%02uZ",
tmst->tm_year + 1900, tmst->tm_mon + 1, tmst->tm_mday,
tmst->tm_hour, tmst->tm_min, tmst->tm_sec);
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp
index 89d8bfe5b1..1028e403cc 100644
--- a/protocols/MSN/src/msn_soapstore.cpp
+++ b/protocols/MSN/src/msn_soapstore.cpp
@@ -71,7 +71,7 @@ ezxml_t CMsnProto::storeSoapHdr(const char* service, const char* scenario, ezxml
char* CMsnProto::GetStoreHost(const char* service)
{
char hostname[128];
- mir_snprintf(hostname, sizeof(hostname), "StoreHost-%s", service);
+ mir_snprintf(hostname, SIZEOF(hostname), "StoreHost-%s", service);
char* host = (char*)mir_alloc(256);
if (db_get_static(NULL, m_szModuleName, hostname, host, 256))
@@ -83,7 +83,7 @@ char* CMsnProto::GetStoreHost(const char* service)
void CMsnProto::UpdateStoreHost(const char* service, const char* url)
{
char hostname[128];
- mir_snprintf(hostname, sizeof(hostname), "StoreHost-%s", service);
+ mir_snprintf(hostname, SIZEOF(hostname), "StoreHost-%s", service);
setString(hostname, url);
}
@@ -257,7 +257,7 @@ bool CMsnProto::MSN_StoreGetProfile(bool allowRecurse)
UpdateStoreHost("GetProfile", body ? storeUrl : NULL);
- mir_snprintf(proresid, sizeof(proresid), "%s", ezxml_txt(ezxml_child(body, "ResourceID")));
+ mir_snprintf(proresid, SIZEOF(proresid), "%s", ezxml_txt(ezxml_child(body, "ResourceID")));
ezxml_t expr = ezxml_child(body, "ExpressionProfile");
if (expr == NULL) {
@@ -272,10 +272,10 @@ bool CMsnProto::MSN_StoreGetProfile(bool allowRecurse)
const char* szStatus = ezxml_txt(ezxml_child(expr, "PersonalStatus"));
replaceStr(msnLastStatusMsg, szStatus);
- mir_snprintf(expresid, sizeof(expresid), "%s", ezxml_txt(ezxml_child(expr, "ResourceID")));
+ mir_snprintf(expresid, SIZEOF(expresid), "%s", ezxml_txt(ezxml_child(expr, "ResourceID")));
ezxml_t photo = ezxml_child(expr, "Photo");
- mir_snprintf(photoid, sizeof(photoid), "%s", ezxml_txt(ezxml_child(photo, "ResourceID")));
+ mir_snprintf(photoid, SIZEOF(photoid), "%s", ezxml_txt(ezxml_child(photo, "ResourceID")));
ezxml_t docstr = ezxml_get(photo, "DocumentStreams", 0, "DocumentStream", -1);
while (docstr) {
@@ -565,7 +565,7 @@ bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMime
if (status == 200) {
ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
ezxml_t bdy = getSoapResponse(xmlm, "CreateDocument");
- mir_snprintf(photoid, sizeof(photoid), "%s", ezxml_txt(bdy));
+ mir_snprintf(photoid, SIZEOF(photoid), "%s", ezxml_txt(bdy));
ezxml_free(xmlm);
}
else if (status == 500) {
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index c82ae24cab..377a9e6e53 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -391,7 +391,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, SIZEOF(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);
@@ -399,7 +399,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, SIZEOF(str), Translate("Connected to server %s."), server_.c_str());
TCHAR *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
@@ -511,7 +511,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, SIZEOF(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);
@@ -665,7 +665,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, SIZEOF(str), Translate("%s disconnected."), Translate(stranger.c_str()));
TCHAR *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp
index b99b25f74b..b4b242be44 100644
--- a/protocols/Sametime/src/conference.cpp
+++ b/protocols/Sametime/src/conference.cpp
@@ -536,13 +536,13 @@ void CSametimeProto::InitConferenceMenu()
mi.pszContactOwner = m_szModuleName;
mi.ptszName = LPGENT("Leave conference");
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENULEAVECHAT);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, MS_SAMETIME_MENULEAVECHAT);
mi.pszService = service;
mi.icolibItem = GetIconHandle(IDI_ICON_LEAVE);
hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi);
mi.ptszName = LPGENT("Start conference");
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUCREATECHAT);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUCREATECHAT);
mi.pszService = service;
mi.icolibItem = GetIconHandle(IDI_ICON_INVITE);
hCreateChatMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index f8966db031..708be8481f 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -108,14 +108,14 @@ HANDLE GetIconHandle(int iconId)
HICON LoadIconEx(const char* name, BOOL big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", "SAMETIME", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", "SAMETIME", name);
return Skin_GetIcon(szSettingName, big);
}
void ReleaseIconEx(const char* name, BOOL big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", "SAMETIME", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", "SAMETIME", name);
Skin_ReleaseIcon(szSettingName, big);
}
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index 358ab48c00..d2922c976c 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -575,7 +575,7 @@ void CSametimeProto::InitSessionMenu()
mi.popupPosition = 500085001;
mi.position = 2000060000;
mi.ptszName = LPGENT("Send announcement...");
- mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUANNOUNCESESSION);
+ mir_snprintf(service, SIZEOF(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUANNOUNCESESSION);
mi.pszService = service;
mi.icolibItem = GetIconHandle(IDI_ICON_ANNOUNCE);
mi.pszContactOwner = m_szModuleName;
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp
index 8fc3c11d8e..2427a8a29d 100644
--- a/protocols/SkypeClassic/src/skype.cpp
+++ b/protocols/SkypeClassic/src/skype.cpp
@@ -833,7 +833,7 @@ int OnModulesLoaded(WPARAM, LPARAM) {
if (!ServiceExists(MS_UTILS_REPLACEVARS) || !(tmpPath = Utils_ReplaceVars("%miranda_avatarcache%")))
tmpPath = PROFILE_PATH;
- mir_snprintf(DefaultAvatarsFolder, sizeof(DefaultAvatarsFolder), "%s\\%s", tmpPath, SKYPE_PROTONAME);
+ mir_snprintf(DefaultAvatarsFolder, SIZEOF(DefaultAvatarsFolder), "%s\\%s", tmpPath, SKYPE_PROTONAME);
hProtocolAvatarsFolder = (HANDLE)FoldersRegisterCustomPath(SKYPE_PROTONAME, "Avatars Cache", DefaultAvatarsFolder);
}
@@ -841,7 +841,7 @@ int OnModulesLoaded(WPARAM, LPARAM) {
{
// Use defaults
CallService(MS_DB_GETPROFILEPATH, (WPARAM)MAX_PATH, (LPARAM)DefaultAvatarsFolder);
- mir_snprintf(DefaultAvatarsFolder, sizeof(DefaultAvatarsFolder), "%s\\%s", DefaultAvatarsFolder, SKYPE_PROTONAME);
+ mir_snprintf(DefaultAvatarsFolder, SIZEOF(DefaultAvatarsFolder), "%s\\%s", DefaultAvatarsFolder, SKYPE_PROTONAME);
CreateDirectoryA(DefaultAvatarsFolder, NULL);
}
@@ -2411,9 +2411,9 @@ void RetrieveUserAvatar(void *param)
// Get filename
FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder);
if (!*AvatarFile) strcpy(AvatarFile, DefaultAvatarsFolder);
- mir_snprintf(AvatarTmpFile, sizeof(AvatarTmpFile), "AVATAR 1 %s\\%s_tmp.jpg", AvatarFile, dbv.pszVal);
+ mir_snprintf(AvatarTmpFile, SIZEOF(AvatarTmpFile), "AVATAR 1 %s\\%s_tmp.jpg", AvatarFile, dbv.pszVal);
pszTempFile = AvatarTmpFile + 9;
- mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal);
+ mir_snprintf(AvatarFile, SIZEOF(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal);
// Just to be sure
DeleteFileA(pszTempFile);
@@ -2511,7 +2511,7 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam, LPARAM lParam)
// Get filename
FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder);
- mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal);
+ mir_snprintf(AvatarFile, SIZEOF(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal);
db_free(&dbv);
// Check if the file exists
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp
index 8ed5900f57..ebc74afeda 100644
--- a/protocols/SkypeClassic/src/skypeapi.cpp
+++ b/protocols/SkypeClassic/src/skypeapi.cpp
@@ -1072,7 +1072,7 @@ INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) {
FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder);
if (!*AvatarFile) strcpy (AvatarFile, DefaultAvatarsFolder);
- mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s avatar.%s", AvatarFile, SKYPE_PROTONAME, ext);
+ mir_snprintf(AvatarFile, SIZEOF(AvatarFile), "%s\\%s avatar.%s", AvatarFile, SKYPE_PROTONAME, ext);
// Backup old file
if (hasOldAvatar)
@@ -1100,7 +1100,7 @@ INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) {
}
// Try to set with skype
- mir_snprintf(command, sizeof(command), "SET AVATAR 1 %s", AvatarFile);
+ mir_snprintf(command, SIZEOF(command), "SET AVATAR 1 %s", AvatarFile);
if (SkypeSend(command) || (ptr = SkypeRcv(command+4, INFINITE)) == NULL || !strncmp(ptr, "ERROR", 5))
{
DeleteFileA(AvatarFile);
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp
index 246e3403a2..69dc438c2a 100644
--- a/protocols/SkypeClassic/src/skypeopt.cpp
+++ b/protocols/SkypeClassic/src/skypeopt.cpp
@@ -755,7 +755,7 @@ int OnDetailsInit( WPARAM wParam, LPARAM lParam )
if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 7, 0, 27) && !bIsImoproxy)
{
- mir_snprintf( szTitle, sizeof( szTitle ), "%s %s", SKYPE_PROTONAME, Translate( "Avatar" ));
+ mir_snprintf( szTitle, SIZEOF( szTitle ), "%s %s", SKYPE_PROTONAME, Translate( "Avatar" ));
odp.pfnDlgProc = AvatarDlgProc;
odp.position = 1900000000;
@@ -764,7 +764,7 @@ int OnDetailsInit( WPARAM wParam, LPARAM lParam )
UserInfo_AddPage(wParam, &odp);
}
- mir_snprintf( szTitle, sizeof( szTitle ), "%s %s", SKYPE_PROTONAME, Translate( "Details" ));
+ mir_snprintf( szTitle, SIZEOF( szTitle ), "%s %s", SKYPE_PROTONAME, Translate( "Details" ));
odp.pfnDlgProc = DetailsDlgProc;
odp.position = 1900000000;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index a872d20484..38249081ca 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -225,7 +225,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam)
}
mir_free(login);
mir_free(password);
- mir_snprintf(szFileName, sizeof(szFileName), "http://poczta.o2.pl/login.html?sid=%s", cookie);
+ mir_snprintf(szFileName, SIZEOF(szFileName), "http://poczta.o2.pl/login.html?sid=%s", cookie);
CallService(MS_UTILS_OPENURL, (WPARAM) 1, (LPARAM) szFileName);
return 0;
}
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp
index 9aa2095994..b0460c24a6 100644
--- a/protocols/Tlen/src/tlen_file.cpp
+++ b/protocols/Tlen/src/tlen_file.cpp
@@ -276,7 +276,7 @@ static void TlenFileSendParse(TLEN_FILE_TRANSFER *ft)
t++;
else
t = ft->files[i];
- mir_snprintf(filename, sizeof(filename)-1, t);
+ mir_snprintf(filename, (SIZEOF(filename) - 1), "%s", t);
TlenP2PPacketPackBuffer(packet, filename, sizeof(filename));
}
TlenP2PPacketSend(ft->s, packet);
@@ -570,9 +570,9 @@ void TlenProcessF(XmlNode *node, ThreadData *info)
if ((from=TlenXmlGetAttrValue(node, "f")) != NULL) {
if (strchr(from, '@') == NULL) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", from, info->server);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, info->server);
} else {
- mir_snprintf(jid, sizeof(jid), "%s", from);
+ mir_snprintf(jid, SIZEOF(jid), "%s", from);
}
if ((e=TlenXmlGetAttrValue(node, "e")) != NULL) {
@@ -597,7 +597,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info)
}
}
else if (numFiles > 1) {
- mir_snprintf(szFilename, sizeof(szFilename), Translate("%d Files"), numFiles);
+ mir_snprintf(szFilename, SIZEOF(szFilename), Translate("%d Files"), numFiles);
}
}
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp
index fe6784d5e0..f041d712ca 100644
--- a/protocols/Tlen/src/tlen_iqid.cpp
+++ b/protocols/Tlen/src/tlen_iqid.cpp
@@ -54,7 +54,7 @@ void TlenIqResultAuth(TlenProtocol *proto, XmlNode *iqNode)
char text[128];
TlenSend(proto, "</s>");
- mir_snprintf(text, sizeof(text), Translate("Authentication failed for %s@%s."), proto->threadData->username, proto->threadData->server);
+ mir_snprintf(text, SIZEOF(text), Translate("Authentication failed for %s@%s."), proto->threadData->username, proto->threadData->server);
MessageBoxA(NULL, text, Translate("Tlen Authentication"), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
proto->threadData = NULL; // To disallow auto reconnect
@@ -419,9 +419,9 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode)
if (!strcmp(itemNode->name, "item")) {
if ((jid=TlenXmlGetAttrValue(itemNode, "jid")) != NULL) {
if (strchr(jid, '@') != NULL) {
- mir_snprintf(jsr.jid, sizeof(jsr.jid), "%s", jid);
+ mir_snprintf(jsr.jid, SIZEOF(jsr.jid), "%s", jid);
} else {
- mir_snprintf(jsr.jid, sizeof(jsr.jid), "%s@%s", jid, dbv.pszVal);
+ mir_snprintf(jsr.jid, SIZEOF(jsr.jid), "%s@%s", jid, dbv.pszVal);
}
jsr.jid[sizeof(jsr.jid)-1] = '\0';
jsr.hdr.id = mir_a2t(jid);
@@ -467,9 +467,9 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode)
if (proto->searchJID != NULL) {
if (!found) {
if (strchr(proto->searchJID, '@') != NULL) {
- mir_snprintf(jsr.jid, sizeof(jsr.jid), "%s", proto->searchJID);
+ mir_snprintf(jsr.jid, SIZEOF(jsr.jid), "%s", proto->searchJID);
} else {
- mir_snprintf(jsr.jid, sizeof(jsr.jid), "%s@%s", proto->searchJID, dbv.pszVal);
+ mir_snprintf(jsr.jid, SIZEOF(jsr.jid), "%s@%s", proto->searchJID, dbv.pszVal);
}
jsr.jid[sizeof(jsr.jid)-1] = '\0';
jsr.hdr.nick = mir_tstrdup(TEXT(""));
@@ -604,7 +604,7 @@ void TlenIqResultInfo(TlenProtocol *proto, XmlNode *iqNode)
if (( hContact=TlenHContactFromJID(proto, item->jid )) != NULL ) {
if (item->software == NULL) {
char str[128];
- mir_snprintf(str, sizeof(str), "Tlen Protocol %s", item->protocolVersion);
+ mir_snprintf(str, SIZEOF(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 035f22243a..0f406d9c77 100644
--- a/protocols/Tlen/src/tlen_muc.cpp
+++ b/protocols/Tlen/src/tlen_muc.cpp
@@ -70,7 +70,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id)
MCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if (((hContact=TlenHContactFromJID(proto, jid)) != NULL) || !strcmp(id, proto->threadData->username)) {
CONTACTINFO ci = { sizeof(ci) };
@@ -107,7 +107,7 @@ int TlenMUCRecvInvitation(TlenProtocol *proto, const char *roomId, const char *r
char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
strcpy(jid, from);
@@ -119,7 +119,7 @@ int TlenMUCRecvInvitation(TlenProtocol *proto, const char *roomId, const char *r
TLEN_LIST_ITEM *item;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
strcpy(jid, from);
@@ -152,9 +152,9 @@ 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, SIZEOF(str), "%s/%s", roomID, nick);
} else {
- mir_snprintf(str, sizeof(str), "%s", roomID);
+ mir_snprintf(str, SIZEOF(str), "%s", roomID);
}
if ((jid = TlenTextEncode(str)) != NULL) {
switch (desiredStatus) {
diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp
index 128bde099d..1591e93c99 100644
--- a/protocols/Tlen/src/tlen_p2p_new.cpp
+++ b/protocols/Tlen/src/tlen_p2p_new.cpp
@@ -185,7 +185,7 @@ void TlenBindUDPSocket(TLEN_FILE_TRANSFER *ft)
char host_name[256];
gethostname(host_name, sizeof(host_name));
hp = gethostbyname(host_name);
- mir_snprintf(host_name, sizeof(host_name), "%u.%u.%u.%u", (unsigned char)hp->h_addr_list[0][0],
+ mir_snprintf(host_name, SIZEOF(host_name), "%u.%u.%u.%u", (unsigned char)hp->h_addr_list[0][0],
(unsigned char)hp->h_addr_list[0][1],
(unsigned char)hp->h_addr_list[0][2],
(unsigned char)hp->h_addr_list[0][3]);
@@ -260,7 +260,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) {
if ((item=TlenListAdd(ft->proto, LIST_FILE, ft->iqId)) != NULL) {
char fileInfo[128];
item->ft = ft;
- mir_snprintf(fileInfo, sizeof(fileInfo), "%s file(s), %s bytes", c, s);
+ mir_snprintf(fileInfo, SIZEOF(fileInfo), "%s file(s), %s bytes", c, s);
TCHAR* filenameT = mir_utf8decodeT((char*)fileInfo);
PROTORECVFILET pre = {0};
pre.flags = PREF_TCHAR;
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp
index c8ca8df1dd..e8bea6e2cb 100644
--- a/protocols/Tlen/src/tlen_p2p_old.cpp
+++ b/protocols/Tlen/src/tlen_p2p_old.cpp
@@ -155,6 +155,7 @@ void TlenP2PEstablishOutgoingConnection(TLEN_FILE_TRANSFER *ft, BOOL sendAck)
{
char *hash;
char str[300];
+ size_t srt_len;
TLEN_FILE_PACKET *packet;
TlenProtocol *proto = ft->proto;
@@ -164,8 +165,8 @@ void TlenP2PEstablishOutgoingConnection(TLEN_FILE_TRANSFER *ft, BOOL sendAck)
TlenP2PPacketSetType(packet, TLEN_FILE_PACKET_CONNECTION_REQUEST);
TlenP2PPacketPackDword(packet, 1);
TlenP2PPacketPackDword(packet, (DWORD) atoi(ft->iqId));
- mir_snprintf(str, sizeof(str), "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId));
- hash = TlenSha1(str, (int)strlen(str));
+ srt_len = mir_snprintf(str, SIZEOF(str), "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId));
+ hash = TlenSha1(str, (int)srt_len);
TlenP2PPacketPackBuffer(packet, hash, 20);
mir_free(hash);
TlenP2PPacketSend(ft->s, packet);
@@ -208,14 +209,14 @@ TLEN_FILE_TRANSFER* TlenP2PEstablishIncomingConnection(TlenProtocol *proto, HAND
i = 0;
while ((i=TlenListFindNext(proto, list, i)) >= 0) {
if ((item=TlenListGetItemPtrFromIndex(proto, i)) != NULL) {
- mir_snprintf(str, sizeof(str), "%d", iqId);
+ mir_snprintf(str, SIZEOF(str), "%d", iqId);
if (!strcmp(item->ft->iqId, str)) {
char *hash, *nick;
int j;
nick = TlenNickFromJID(item->ft->jid);
- mir_snprintf(str, sizeof(str), "%08X%s%d", iqId, nick, iqId);
+ j = mir_snprintf(str, SIZEOF(str), "%08X%s%d", iqId, nick, iqId);
mir_free(nick);
- hash = TlenSha1(str, (int)strlen(str));
+ hash = TlenSha1(str, j);
for (j=0;j<20;j++) {
if (hash[j] != packet->packet[2*sizeof(DWORD)+j]) break;
}
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp
index f97cc1fb78..0d39b3db7f 100644
--- a/protocols/Tlen/src/tlen_picture.cpp
+++ b/protocols/Tlen/src/tlen_picture.cpp
@@ -34,7 +34,7 @@ static void LogPictureMessage(TlenProtocol *proto, const char *jid, const char *
{
char message[1024];
const char *msg = isSent ? LPGEN("Image sent file://%s") : LPGEN("Image received file://%s");
- mir_snprintf(message, sizeof(message), Translate(msg), filename);
+ mir_snprintf(message, SIZEOF(message), Translate(msg), filename);
TlenLogMessage(proto, TlenHContactFromJID(proto, jid), isSent ? DBEF_SENT : 0, message);
}
@@ -49,8 +49,8 @@ static void TlenPsPostThread(void *ptr) {
DWORD ret;
item->ft->s = socket;
item->ft->hFileEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- mir_snprintf(header, sizeof(header), "<pic auth='%s' t='p' to='%s' size='%d' idt='%s'/>", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid);
- TlenWsSend(proto, socket, header, (int)strlen(header));
+ ret = mir_snprintf(header, SIZEOF(header), "<pic auth='%s' t='p' to='%s' size='%d' idt='%s'/>", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid);
+ TlenWsSend(proto, socket, header, (int)ret);
ret = WaitForSingleObject(item->ft->hFileEvent, 1000 * 60 * 5);
if (ret == WAIT_OBJECT_0) {
FILE *fp = fopen( item->ft->files[0], "rb" );
@@ -58,8 +58,8 @@ static void TlenPsPostThread(void *ptr) {
int i;
char header[512];
char fileBuffer[2048];
- mir_snprintf(header, sizeof(header), "<pic st='%s' idt='%s'/>", item->ft->iqId, item->jid);
- TlenWsSend(proto, socket, header, (int)strlen(header));
+ i = mir_snprintf(header, SIZEOF(header), "<pic st='%s' idt='%s'/>", item->ft->iqId, item->jid);
+ TlenWsSend(proto, socket, header, i);
proto->debugLogA("Sending picture data...");
for (i = item->ft->filesSize[0]; i > 0; ) {
int toread = min(2048, i);
@@ -114,8 +114,8 @@ static void TlenPsGetThread(void *ptr) {
char header[512];
char fileBuffer[2048];
TlenXmlInitState(&xmlState);
- mir_snprintf(header, sizeof(header), "<pic auth='%s' t='g' to='%s' pid='1001' idt='%s' rt='%s'/>", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2);
- TlenWsSend(proto, socket, header, (int)strlen(header));
+ int header_len = mir_snprintf(header, SIZEOF(header), "<pic auth='%s' t='g' to='%s' pid='1001' idt='%s' rt='%s'/>", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2);
+ TlenWsSend(proto, socket, header, header_len);
proto->debugLogA("Reveiving picture data...");
{
int totalcount = 0;
@@ -284,7 +284,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) {
char idStr[10];
char fileBuffer[2048];
int id = TlenSerialNext(proto);
- mir_snprintf(idStr, sizeof(idStr), "%d", id);
+ mir_snprintf(idStr, SIZEOF(idStr), "%d", id);
item = TlenListAdd(proto, LIST_PICTURE, idStr);
item->ft = TlenFileCreateFT(proto, jid);
item->ft->files = (char **) mir_alloc(sizeof(char *));
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 9cbe6eb764..63520406de 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -829,7 +829,7 @@ HANDLE TlenProtocol::SendFile(MCONTACT hContact, const PROTOCHAR* szDescription,
db_free(&dbv);
id = TlenSerialNext(this);
- mir_snprintf(idStr, sizeof(idStr), "%d", id);
+ mir_snprintf(idStr, SIZEOF(idStr), "%d", id);
if ((item=TlenListAdd(this, LIST_FILE, idStr)) != NULL) {
ft->iqId = mir_strdup(idStr);
nick = TlenNickFromJID(ft->jid);
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 0f634b6cff..c243fa11ec 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -206,7 +206,7 @@ void __cdecl TlenServerThread(ThreadData *info)
return;
}
- mir_snprintf(jidStr, sizeof(jidStr), "%s@%s", info->username, info->server);
+ mir_snprintf(jidStr, SIZEOF(jidStr), "%s@%s", info->username, info->server);
db_set_s(NULL, info->proto->m_szModuleName, "jid", jidStr);
if (!db_get(NULL, info->proto->m_szModuleName, "ManualHost", &dbv)) {
@@ -1188,9 +1188,9 @@ static void TlenProcessV(XmlNode *node, ThreadData *info)
if ((from=TlenXmlGetAttrValue(node, "f")) != NULL) {
if (strchr(from, '@') == NULL) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", from, info->server);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, info->server);
} else {
- mir_snprintf(jid, sizeof(jid), "%s", from);
+ mir_snprintf(jid, SIZEOF(jid), "%s", from);
}
if ((e=TlenXmlGetAttrValue(node, "e")) != NULL) {
if (!strcmp(e, "1")) {
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index dff4305394..a6c2ab91cb 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -932,7 +932,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id)
MCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if ((hContact=TlenHContactFromJID(proto, jid)) != NULL)
return mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, 0));
@@ -1012,7 +1012,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from)
char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
strcpy(jid, from);
@@ -1023,7 +1023,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from)
char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, sizeof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
strcpy(jid, from);
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp
index 27ee2f4553..ee0b957176 100644
--- a/protocols/Twitter/src/ui.cpp
+++ b/protocols/Twitter/src/ui.cpp
@@ -136,8 +136,8 @@ 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[4];
- mir_snprintf(str, sizeof(str), "%d", 140 - len);
+ char str[16];
+ mir_snprintf(str, SIZEOF(str), "%d", 140 - len);
SetDlgItemTextA(hwndDlg, IDC_CHARACTERS, str);
return true;
@@ -146,14 +146,14 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
break;
case WM_SETREPLY:
char foo[512];
- mir_snprintf(foo, sizeof(foo), "@%s ", (char*)wParam);
+ mir_snprintf(foo, SIZEOF(foo), "@%s ", (char*)wParam);
size_t len = strlen(foo);
SetDlgItemTextA(hwndDlg, IDC_TWEETMSG, foo);
SendDlgItemMessage(hwndDlg, IDC_TWEETMSG, EM_SETSEL, len, len);
- char str[4];
- mir_snprintf(str, sizeof(str), "%d", 140 - len);
+ char str[16];
+ mir_snprintf(str, SIZEOF(str), "%d", 140 - len);
SetDlgItemTextA(hwndDlg, IDC_CHARACTERS, str);
return true;
@@ -190,7 +190,7 @@ INT_PTR CALLBACK options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
else SendDlgItemMessage(hwndDlg, IDC_BASEURL, CB_SETCURSEL, 0, 0);
char pollrate_str[32];
- mir_snprintf(pollrate_str, sizeof(pollrate_str), "%d", db_get_dw(0, proto->ModuleName(), TWITTER_KEY_POLLRATE, 80));
+ mir_snprintf(pollrate_str, SIZEOF(pollrate_str), "%d", db_get_dw(0, proto->ModuleName(), TWITTER_KEY_POLLRATE, 80));
SetDlgItemTextA(hwndDlg, IDC_POLLRATE, pollrate_str);
CheckDlgButton(hwndDlg, IDC_TWEET_MSG, db_get_b(0, proto->ModuleName(), TWITTER_KEY_TWEET_TO_MSG, 0));
@@ -396,7 +396,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, SIZEOF(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 624f14c464..b895974728 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -151,14 +151,14 @@ 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, SIZEOF(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_VISITPROFILE);
+ mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_VISITPROFILE);
mi.pszService = szService;
mi.position = 10009 + PMI_VISITPROFILE;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
@@ -173,42 +173,42 @@ 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_ADDASFRIEND);
+ mir_snprintf(szService, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(szService), "%s%s", m_szModuleName, PS_OPENBROADCAST);
mi.position = -200001000 + CMI_OPENBROADCAST;
mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
mi.ptszName = LPGENT("Open broadcast");
@@ -216,7 +216,7 @@ void CVkProto::InitMenus()
g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi);
// Sync history menu
- mir_snprintf(szService, sizeof(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORY);
+ mir_snprintf(szService, SIZEOF(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...");
@@ -226,42 +226,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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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");
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp
index 9fcd34270a..c35b1d0432 100644
--- a/protocols/Yahoo/src/chat.cpp
+++ b/protocols/Yahoo/src/chat.cpp
@@ -53,7 +53,7 @@ void CALLBACK ConferenceRequestCB(PVOID dwParam);
void ext_yahoo_got_conf_invite(int id, const char *me, const char *who, const char *room, const char *msg, YList *members)
{
char z[1024];
- mir_snprintf(z, sizeof(z), Translate("[miranda] Got conference invite to room: %s with msg: %s"), room ?room:"", msg ?msg:"");
+ mir_snprintf(z, SIZEOF(z), Translate("[miranda] Got conference invite to room: %s with msg: %s"), room ?room:"", msg ?msg:"");
LOG(("[ext_yahoo_got_conf_invite] %s", z));
CYahooProto* ppro = getProtoById(id);
@@ -653,7 +653,7 @@ static void CALLBACK ConferenceRequestCB(PVOID pParam)
INT_PTR __cdecl CYahooProto::CreateConference(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
char room[128];
- mir_snprintf(room, sizeof(room), "%s-%u", m_yahoo_id, time(NULL));
+ mir_snprintf(room, SIZEOF(room), "%s-%u", m_yahoo_id, time(NULL));
InviteChatParam* param = new InviteChatParam(room, this);
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL,
diff --git a/protocols/Yahoo/src/icolib.cpp b/protocols/Yahoo/src/icolib.cpp
index 3e713a2388..69cb3eb97c 100644
--- a/protocols/Yahoo/src/icolib.cpp
+++ b/protocols/Yahoo/src/icolib.cpp
@@ -36,7 +36,7 @@ void CYahooProto::IconsInit( void )
HICON CYahooProto::LoadIconEx( const char* name, bool big )
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "YAHOO_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "YAHOO_%s", name);
return Skin_GetIcon(szSettingName, big);
}
@@ -52,6 +52,6 @@ HANDLE CYahooProto::GetIconHandle(int iconId)
void CYahooProto::ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "YAHOO_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "YAHOO_%s", name);
Skin_ReleaseIcon(szSettingName, big);
}
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp
index 108c893eb1..efc52a9484 100644
--- a/protocols/Yahoo/src/services.cpp
+++ b/protocols/Yahoo/src/services.cpp
@@ -225,7 +225,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin)
y = yahoo_urlencode(yahoo_get_cookie(m_id, "y"));
t = yahoo_urlencode(yahoo_get_cookie(m_id, "t"));
u = yahoo_urlencode(url);
- mir_snprintf(tUrl, sizeof(tUrl),
+ mir_snprintf(tUrl, SIZEOF(tUrl),
"http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.t=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s",
y, t, u);
@@ -233,7 +233,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin)
FREE(t);
FREE(u);
} else {
- mir_snprintf(tUrl, sizeof(tUrl), url);
+ mir_snprintf(tUrl, SIZEOF(tUrl), url);
}
debugLogA("[YahooOpenURL] url: %s Final URL: %s", url, tUrl);
@@ -259,7 +259,7 @@ INT_PTR __cdecl CYahooProto::OnShowProfileCommand(WPARAM wParam, LPARAM lParam)
if (getString(wParam, YAHOO_LOGINID, &dbv))
return 0;
- mir_snprintf(tUrl, sizeof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
+ mir_snprintf(tUrl, SIZEOF(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
db_free(&dbv);
OpenURL(tUrl, 0);
@@ -285,7 +285,7 @@ INT_PTR __cdecl CYahooProto::OnShowMyProfileCommand( WPARAM wParam, LPARAM lPara
}
char tUrl[ 4096 ];
- mir_snprintf(tUrl, sizeof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
+ mir_snprintf(tUrl, SIZEOF(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
db_free(&dbv);
OpenURL(tUrl, 0);
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp
index d030ba7c75..68b10aac50 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, SIZEOF(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.cpp b/protocols/Yahoo/src/yahoo.cpp
index 05d56e98c1..44e313320e 100644
--- a/protocols/Yahoo/src/yahoo.cpp
+++ b/protocols/Yahoo/src/yahoo.cpp
@@ -576,7 +576,7 @@ void CYahooProto::ext_got_audible(const char *me, const char *who, const char *a
}
char z[1028];
- mir_snprintf(z, sizeof(z), "[miranda-audible] %s", msg ?msg:"");
+ mir_snprintf(z, SIZEOF(z), "[miranda-audible] %s", msg ?msg:"");
ext_got_im((char*)me, (char*)who, 0, z, 0, 0, 1, -1, NULL, 0);
}
@@ -792,14 +792,14 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha
nick[0] = '\0';
if (lname && fname)
- mir_snprintf(nick, sizeof(nick), "%s %s", fname, lname);
+ mir_snprintf(nick, SIZEOF(nick), "%s %s", fname, lname);
else if (lname)
- mir_snprintf(nick, sizeof(nick), "%s", lname);
+ mir_snprintf(nick, SIZEOF(nick), "%s", lname);
else if (fname)
- mir_snprintf(nick, sizeof(nick), "%s", fname);
+ mir_snprintf(nick, SIZEOF(nick), "%s", fname);
if (nick[0] == '\0')
- mir_snprintf(nick, sizeof(nick), "%s", who);
+ mir_snprintf(nick, SIZEOF(nick), "%s", who);
if (fname) SetStringUtf(hContact, "FirstName", fname);
if (lname) SetStringUtf(hContact, "LastName", lname);
@@ -1052,7 +1052,7 @@ void ext_yahoo_got_cookies(int id)
char z[1024];
// need to add Cookie header to our requests or we get booted w/ "Bad Cookie" message.
- mir_snprintf(z, sizeof(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
+ mir_snprintf(z, SIZEOF(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
yahoo_get_cookie(id, "t"), yahoo_get_cookie(id, "c"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hNetlibUser, (LPARAM)z);
@@ -1546,11 +1546,11 @@ void CYahooProto::ext_login(enum yahoo_status login_mode)
if (host[0] == '\0') {
if (!getString(YAHOO_LOGINSERVER, &dbv)) {
- mir_snprintf(host, sizeof(host), "%s", dbv.pszVal);
+ mir_snprintf(host, SIZEOF(host), "%s", dbv.pszVal);
db_free(&dbv);
}
else {
- mir_snprintf(host, sizeof(host), "%s",
+ mir_snprintf(host, SIZEOF(host), "%s",
getByte("YahooJapan",0) != 0 ? YAHOO_DEFAULT_JAPAN_LOGIN_SERVER :
YAHOO_DEFAULT_LOGIN_SERVER
);