summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/AssocMgr/src/assoclist.cpp16
-rw-r--r--plugins/AssocMgr/src/test.cpp22
-rw-r--r--plugins/AvatarHistory/src/utils.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp17
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp2
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp2
-rw-r--r--plugins/Clist_nicer/src/clui.cpp6
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp2
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.cpp38
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp36
-rw-r--r--plugins/CountryFlags/src/utils.cpp8
-rw-r--r--plugins/CrashDumper/src/upload.cpp8
-rw-r--r--plugins/Db3x_mmap/src/database.cpp10
-rw-r--r--plugins/Db3x_mmap/src/dbcontacts.cpp4
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp2
-rw-r--r--plugins/FTPFileYM/src/job_delete.cpp8
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp18
-rw-r--r--plugins/FTPFileYM/src/manager.cpp2
-rw-r--r--plugins/FTPFileYM/src/mir_db.cpp22
-rw-r--r--plugins/FTPFileYM/src/serverlist.cpp2
-rw-r--r--plugins/FTPFileYM/src/utils.cpp4
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp16
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp18
-rw-r--r--plugins/HTTPServer/src/HttpUser.cpp10
-rw-r--r--plugins/HTTPServer/src/main.cpp2
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp4
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp8
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp2
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp54
-rw-r--r--plugins/Nudge/src/main.cpp10
-rw-r--r--plugins/OpenFolder/src/openFolder.cpp2
-rw-r--r--plugins/Popup/src/font.cpp10
-rw-r--r--plugins/Popup/src/font.h2
-rw-r--r--plugins/Popup/src/notifications.cpp38
-rw-r--r--plugins/Popup/src/opt_class.cpp22
-rw-r--r--plugins/Popup/src/opt_gen.cpp2
-rw-r--r--plugins/Popup/src/opt_skins.cpp2
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp4
-rw-r--r--plugins/Popup/src/services.cpp6
-rw-r--r--plugins/Popup/src/skin.cpp4
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp4
-rw-r--r--plugins/QuickMessages/src/Utils.cpp51
-rw-r--r--plugins/RemovePersonalSettings/src/rps.cpp10
-rw-r--r--plugins/SMS/src/SMS_svc.cpp2
-rw-r--r--plugins/SMS/src/functions.cpp14
-rw-r--r--plugins/SMS/src/senddlg.cpp4
-rw-r--r--plugins/Scriver/src/msgdialog.cpp2
-rw-r--r--plugins/SimpleStatusMsg/src/utils.cpp6
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp6
-rw-r--r--plugins/StartupSilence/src/main.cpp2
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp12
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/options.cpp12
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.cpp8
-rw-r--r--plugins/StatusPlugins/KeepStatus/options.cpp4
-rw-r--r--plugins/StatusPlugins/StartupStatus/options.cpp6
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp12
-rw-r--r--plugins/StatusPlugins/StartupStatus/startupstatus.cpp10
-rw-r--r--plugins/StatusPlugins/StartupStatus/toolbars.cpp4
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp12
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp2
-rw-r--r--plugins/TabSRMM/src/container.cpp2
-rw-r--r--plugins/TabSRMM/src/msglog.cpp4
-rw-r--r--plugins/TabSRMM/src/utils.cpp3
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp10
-rw-r--r--plugins/Variables/src/dbhelpers.h18
-rw-r--r--plugins/Variables/src/parse_inet.cpp2
-rw-r--r--plugins/XSoundNotify/src/xsn_main.cpp4
-rw-r--r--plugins/YahooGroups/src/services.cpp16
-rw-r--r--plugins/helpers/gen_helpers.cpp6
-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
-rw-r--r--src/mir_core/langpack.cpp2
-rw-r--r--src/modules/clist/clistmenus.cpp4
-rw-r--r--src/modules/clist/genmenu.cpp2
-rw-r--r--src/modules/clist/genmenuopt.cpp4
-rw-r--r--src/modules/database/dbutils.cpp6
-rw-r--r--src/modules/metacontacts/meta_utils.cpp4
-rw-r--r--src/modules/netlib/netlibautoproxy.cpp6
-rw-r--r--src/modules/netlib/netlibsock.cpp2
-rw-r--r--src/modules/netlib/netlibupnp.cpp6
-rw-r--r--src/modules/protocols/protoaccs.cpp2
-rw-r--r--src/modules/utils/enterstring.cpp4
154 files changed, 654 insertions, 646 deletions
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp
index 9380ebfd69..a0692e1d38 100644
--- a/plugins/AssocMgr/src/assoclist.cpp
+++ b/plugins/AssocMgr/src/assoclist.cpp
@@ -50,7 +50,7 @@ static CRITICAL_SECTION csAssocList;
static BOOL IsAssocEnabled(const ASSOCDATA *assoc)
{
char szSetting[MAXMODULELABELLENGTH];
- mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName);
return db_get_b(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0;
}
@@ -58,13 +58,13 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
{
char szSetting[MAXMODULELABELLENGTH];
TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH];
- mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName);
db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
/* dll name for uninstall */
if(assoc->hInstance!= NULL && assoc->hInstance!= hInst && assoc->hInstance!= GetModuleHandle(NULL))
if( GetModuleFileName(assoc->hInstance, szBuf, SIZEOF(szBuf)))
if( PathToRelativeT(szBuf, szDLL)) {
- mir_snprintf(szSetting, sizeof(szSetting), "module_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", assoc->pszClassName);
db_set_ts(NULL, "AssocMgr", szSetting, szDLL);
}
}
@@ -72,10 +72,10 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
static void DeleteAssocEnabledSetting(const ASSOCDATA *assoc)
{
char szSetting[MAXMODULELABELLENGTH];
- mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName);
db_unset(NULL, "AssocMgr", szSetting);
/* dll name for uninstall */
- mir_snprintf(szSetting, sizeof(szSetting), "module_%s", assoc->pszClassName);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", assoc->pszClassName);
db_unset(NULL, "AssocMgr", szSetting);
}
@@ -94,7 +94,7 @@ void CleanupAssocEnabledSettings(void)
EnterCriticalSection(&csAssocList);
for(i = 0;i<nSettingsCount;++i) {
pszSuffix = &ppszSettings[i][8];
- mir_snprintf(szSetting, sizeof(szSetting), "module_%s", pszSuffix);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", pszSuffix);
if (!db_get_ts(NULL, "AssocMgr", szSetting, &dbv)) {
if( PathToAbsoluteT(dbv.ptszVal, szDLL)) {
/* file still exists? */
@@ -118,7 +118,7 @@ void CleanupAssocEnabledSettings(void)
static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char *pszFileExt, BYTE fAdded)
{
char szSetting[MAXMODULELABELLENGTH];
- mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "mime_%s", pszMimeType);
if(fAdded) db_set_s(NULL, "AssocMgr", szSetting, pszFileExt);
else db_unset(NULL, "AssocMgr", szSetting);
}
@@ -128,7 +128,7 @@ static __inline BOOL WasMimeTypeAdded(const char *pszMimeType)
char szSetting[MAXMODULELABELLENGTH];
DBVARIANT dbv;
BOOL fAdded = FALSE;
- mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "mime_%s", pszMimeType);
if (!db_get(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
else db_free(&dbv);
return fAdded;
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp
index 7618ba9f04..a1ce3308d0 100644
--- a/plugins/AssocMgr/src/test.cpp
+++ b/plugins/AssocMgr/src/test.cpp
@@ -173,7 +173,7 @@ static int AimLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
char service_name[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(service_name,sizeof(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
+ mir_snprintf(service_name,SIZEOF(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
/* or "AOL Instant Messenger Links" */
AssocMgr_AddNewUrlType("aim:",Translate("AIM link protocol"),conn.hInstance,IDI_AOL,service_name,0);
return 0;
@@ -183,7 +183,7 @@ void aim_links_init()
{
char service_name[MAXMODULELABELLENGTH];
//LOG(LOG_DEBUG,"Links: init");
- mir_snprintf(service_name,sizeof(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
+ mir_snprintf(service_name,SIZEOF(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
hServiceParseLink=CreateServiceFunction(service_name,ServiceParseAimLink);
hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,AimLinksModulesLoaded);
}
@@ -479,7 +479,7 @@ static int YmsgrLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,sizeof(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
AssocMgr_AddNewUrlType("ymsgr:",Translate("Yahoo link protocol"),hinstance,IDI_YAHOO,szService,0);
return 0;
}
@@ -487,7 +487,7 @@ static int YmsgrLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
void YmsgrLinksInit(void)
{
char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,sizeof(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
hServiceParseYmsgrLink=CreateServiceFunction(szService,ServiceParseYmsgrLink);
hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,YmsgrLinksModulesLoaded);
}
@@ -586,7 +586,7 @@ static int MsnLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,sizeof(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
AssocMgr_AddNewUrlType("msnim:",Translate("MSN link protocol"),hInst,IDI_MSN,szService,0);
return 0;
}
@@ -594,7 +594,7 @@ static int MsnLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
int LoadMsnLinks(void)
{
char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,sizeof(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
hServiceParseMsnimLink=CreateServiceFunction(szService,ServiceParseMsnimLink);
hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,MsnLinksModulesLoaded);
return 0;
@@ -651,7 +651,7 @@ static int LinksModulesLoaded(WPARAM wParam,LPARAM lParam)
char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,sizeof(szService),"%s%s",GG_PROTO,"ParseMsnimLink");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",GG_PROTO,"ParseMsnimLink");
AssocMgr_AddNewUrlType("gg:",Translate("Gadu-Gadu link protocol"),hInstance,IDI_GG,szService,0);
return 0;
}
@@ -659,7 +659,7 @@ static int LinksModulesLoaded(WPARAM wParam,LPARAM lParam)
void gg_registerlinks(void)
{
char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,sizeof(szService),"%s%s",GG_PROTO,"ParseLink");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",GG_PROTO,"ParseLink");
hServiceParseLink=CreateServiceFunction(szService,ServiceParseLink);
hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,LinksModulesLoaded);
}
@@ -728,7 +728,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
if(ServiceExists(MS_MSG_SENDMESSAGE)) {
hContact=JabberDBCreateContact(jid,jid,TRUE,FALSE);
if(subj!=NULL && body!=NULL) {
- mir_snprintf(msg,sizeof(msg),"%.128s %s",subj,body);
+ mir_snprintf(msg,SIZEOF(msg),"%.128s %s",subj,body);
body=msg;
} else if(body==NULL) body=subj;
if(hContact!=NULL)
@@ -777,7 +777,7 @@ static int JabberLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,sizeof(szService),"%s%s",jabberProtoName,"ParseXmppURI");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",jabberProtoName,"ParseXmppURI");
AssocMgr_AddNewUrlType("xmpp:",Translate("Jabber link protocol"),hInst,IDI_JABBER,szService,0);
return 0;
}
@@ -785,7 +785,7 @@ static int JabberLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
int JabberLinksInit()
{
char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,sizeof(szService),"%s%s",jabberProtoName,"ParseXmppURI");
+ mir_snprintf(szService,SIZEOF(szService),"%s%s",jabberProtoName,"ParseXmppURI");
hServiceParseXmppURI=CreateServiceFunction(szService,ServiceParseXmppURI);
hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,JabberLinksModulesLoaded);
return 0;
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp
index 69b5efb990..4829ea83ed 100644
--- a/plugins/AvatarHistory/src/utils.cpp
+++ b/plugins/AvatarHistory/src/utils.cpp
@@ -30,7 +30,7 @@ BOOL ProtocolEnabled(const char *proto)
return FALSE;
char setting[256];
- mir_snprintf(setting, sizeof(setting), "%sEnabled", proto);
+ mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto);
return (BOOL) db_get_b(NULL, MODULE_NAME, setting, TRUE);
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index 39108c1c96..2e144d30c4 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -2060,16 +2060,17 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin)
static void RegisterMaskByParce(const char * szSetting, char * szValue, SKINOBJECTSLIST * pSkin)
{
- int i;
- DWORD ID=atoi(szSetting+1);
- for (i=0; i < mir_strlen(szValue); i++)
+ size_t i, val_len = mir_strlen(szValue);
+
+ for (i = 0; i < val_len; i ++)
if (szValue[i] == ':')
break;
- if (i < mir_strlen(szValue))
+ if (i < val_len)
{
char * Obj, *Mask;
int res;
+ DWORD ID = atoi(szSetting + 1);
Mask = szValue+i+1;
Obj = (char*)mir_alloc(i+1);
strncpy(Obj,szValue,i);
@@ -3336,13 +3337,13 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting)
BitBlt(g_pCachedWindow->hImageDC, rLine.left, rLine.top, rLine.right - rLine.left, rLine.bottom - rLine.top, g_pCachedWindow->hBackDC, rLine.left, rLine.top, SRCCOPY);
char req[255];
- mir_snprintf(req, sizeof(req), "Main,ID=ScrollBar,Frame=%s,Part=Back", Frame->szName);
+ mir_snprintf(req, SIZEOF(req), "Main,ID=ScrollBar,Frame=%s,Part=Back", Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rLine,&rLine,req);
- mir_snprintf(req, sizeof(req), "Main,ID=ScrollBar,Frame=%s,Part=Thumb", Frame->szName);
+ mir_snprintf(req, SIZEOF(req), "Main,ID=ScrollBar,Frame=%s,Part=Thumb", Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rThumb,&rThumb,req);
- mir_snprintf(req, sizeof(req), "Main,ID=ScrollBar, Frame=%s,Part=UpLineButton", Frame->szName);
+ mir_snprintf(req, SIZEOF(req), "Main,ID=ScrollBar, Frame=%s,Part=UpLineButton", Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rUpBtn,&rUpBtn,req);
- mir_snprintf(req, sizeof(req), "Main,ID=ScrollBar,Frame=%s,Part=DownLineButton", Frame->szName);
+ mir_snprintf(req, SIZEOF(req), "Main,ID=ScrollBar,Frame=%s,Part=DownLineButton", Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rDnBtn,&rDnBtn,req);
}
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index dfdce7c9a9..3a18f1ba92 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -477,7 +477,7 @@ int LocateStorePosition(int Frameid, int maxstored)
for (int i = 0; i < maxstored; i++) {
char settingname[255];
- mir_snprintf(settingname, sizeof(settingname), "Name%d", i);
+ mir_snprintf(settingname, SIZEOF(settingname), "Name%d", i);
ptrT frmname(db_get_tsa(0, CLUIFrameModule, settingname));
if (frmname == NULL) continue;
if (mir_tstrcmpi(frmname, Frames[Frameid].name) == 0)
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index 2edc82614f..fba78d7009 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -488,7 +488,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str
}
// check the proto, use it as a base filter result for all further checks
if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) {
- mir_snprintf(szTemp, sizeof(szTemp), "%s|", szProto);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", szProto);
filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
}
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 6b3f548bf7..593b765869 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -252,7 +252,7 @@ static void CacheClientIcons()
for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) {
char szBuffer[128];
- mir_snprintf(szBuffer, sizeof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE));
+ mir_snprintf(szBuffer, SIZEOF(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE));
overlayicons[i - IDI_OVL_OFFLINE] = Skin_GetIcon(szBuffer);
}
}
@@ -263,7 +263,7 @@ static void InitIcoLib()
for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) {
char szBuffer[128];
- mir_snprintf(szBuffer, sizeof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE));
+ mir_snprintf(szBuffer, SIZEOF(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE));
IconItemT icon = { pcli->pfnGetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), GSMDF_TCHAR), szBuffer, i };
Icon_RegisterT(g_hInst, LPGENT("Contact list")_T("/")LPGENT("Overlay icons"), &icon, 1);
}
@@ -1886,7 +1886,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
{
char str[64];
DWORD v = pluginInfo.version;
- mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
+ mir_snprintf(str, SIZEOF(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
SetDlgItemTextA(hwndDlg, IDC_VERSION, str);
}
{
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 318818105e..d124c0cedc 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -973,7 +973,7 @@ static void BTN_ReadItem(char *itemName, char *file)
ImageItem *imgItem = g_ImageItems;
memset(&tmpItem, 0, sizeof(tmpItem));
- mir_snprintf(tmpItem.szName, sizeof(tmpItem.szName), "%s", &itemName[1]);
+ mir_snprintf(tmpItem.szName, SIZEOF(tmpItem.szName), "%s", &itemName[1]);
tmpItem.width = GetPrivateProfileIntA(itemName, "Width", 16, file);
tmpItem.height = GetPrivateProfileIntA(itemName, "Height", 16, file);
tmpItem.xOff = GetPrivateProfileIntA(itemName, "xoff", 0, file);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp
index 8c62e69617..512fa76ed8 100644
--- a/plugins/CmdLine/src/mimcmd_handlers.cpp
+++ b/plugins/CmdLine/src/mimcmd_handlers.cpp
@@ -390,14 +390,14 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re
PrettyStatusMode(status, pn, sizeof(pn));
if (res)
{
- mir_snprintf(buffer, sizeof(buffer), Translate("Failed to set '%S' status message to '%s' (status is '%s')."), accounts[i]->tszAccountName , awayMsg, pn);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("Failed to set '%S' status message to '%s' (status is '%s')."), accounts[i]->tszAccountName , awayMsg, pn);
}
else{
- mir_snprintf(buffer, sizeof(buffer), Translate("Successfully set '%S' status message to '%s' (status is '%s')."), accounts[i]->tszAccountName, awayMsg, pn);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("Successfully set '%S' status message to '%s' (status is '%s')."), accounts[i]->tszAccountName, awayMsg, pn);
}
}
else{
- mir_snprintf(buffer, sizeof(buffer), Translate("Account '%S' does not support away messages, skipping."), accounts[i]->tszAccountName);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("Account '%S' does not support away messages, skipping."), accounts[i]->tszAccountName);
}
if (i != 0)
@@ -899,7 +899,7 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re
{
if (ack->szModule)
{
- mir_snprintf(buffer, sizeof(buffer), Translate("Message sent to '%s'."), contact);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("Message sent to '%s'."), contact);
DBEVENTINFO e = {0};
char module[128];
@@ -916,13 +916,13 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re
db_event_add(ack->hContact, &e);
}
- else mir_snprintf(buffer, sizeof(buffer), Translate("Message to '%s' was marked as sent but the account seems to be offline"), contact);
+ else mir_snprintf(buffer, SIZEOF(buffer), Translate("Message to '%s' was marked as sent but the account seems to be offline"), contact);
}
- else mir_snprintf(buffer, sizeof(buffer), Translate("Could not send message to '%s'."), contact);
+ else mir_snprintf(buffer, SIZEOF(buffer), Translate("Could not send message to '%s'."), contact);
}
- else mir_snprintf(buffer, sizeof(buffer), Translate("Timed out while waiting for acknowledgement for contact '%s'."), contact);
+ else mir_snprintf(buffer, SIZEOF(buffer), Translate("Timed out while waiting for acknowledgement for contact '%s'."), contact);
}
- else mir_snprintf(buffer, sizeof(buffer), Translate("Could not find contact handle for contact '%s'."), contact);
+ else mir_snprintf(buffer, SIZEOF(buffer), Translate("Could not find contact handle for contact '%s'."), contact);
if (i == 3)
{
@@ -1188,7 +1188,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe
int value = db_get_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, sizeof(buffer), "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
+ mir_snprintf(buffer, SIZEOF(buffer), "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
break;
}
@@ -1203,7 +1203,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe
db_set_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, sizeof(buffer), Translate("'%s' proxy was disabled."), protocol);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("'%s' proxy was disabled."), protocol);
break;
}
@@ -1213,7 +1213,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe
db_set_b(NULL, module, "NLUseProxy", 1);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, sizeof(buffer), Translate("'%s' proxy was enabled."), protocol);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("'%s' proxy was enabled."), protocol);
break;
}
@@ -1225,7 +1225,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe
db_set_b(NULL, module, "NLUseProxy", value);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, sizeof(buffer), (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
+ mir_snprintf(buffer, SIZEOF(buffer), (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
break;
}
@@ -1255,7 +1255,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe
PrettyProxyType(db_get_b(NULL, module, "NLProxyType", 0), type, sizeof(type));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, sizeof(buffer), Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
break;
}
@@ -1275,11 +1275,11 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe
db_set_b(NULL, module, "NLProxyType", type);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, sizeof(buffer), Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(buffer, sizeof(buffer), Translate("%s The port or the proxy type parameter is invalid."), protocol);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("%s The port or the proxy type parameter is invalid."), protocol);
}
break;
@@ -1465,7 +1465,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r
char *id = GetContactID(hContact, protocol);
if (ContactMatchSearch(hContact, contact, id, protocol, &argv[3], argc - 3))
{
- mir_snprintf(buffer, sizeof(buffer), "%s:[%s]:%s (%08d)", contact, id, protocol, hContact);
+ mir_snprintf(buffer, SIZEOF(buffer), "%s:[%s]:%s (%08d)", contact, id, protocol, hContact);
if (count)
{
strncat(reply->message, "\n", reply->cMessage);
@@ -1544,8 +1544,8 @@ void AddHistoryEvent(DBEVENTINFO *dbEvent, char *contact, PReply reply)
char *sender = (dbEvent->flags & DBEF_SENT) ? Translate("[me]") : contact;
char *message = DbGetEventTextA(dbEvent,CP_ACP);
- static char buffer[6144];
- mir_snprintf(buffer, sizeof(buffer), "[%s] %15s: %s", timestamp, sender, message);
+ static char buffer[8192];
+ mir_snprintf(buffer, SIZEOF(buffer), "[%s] %15s: %s", timestamp, sender, message);
if (reply->message[0] != 0)
@@ -1601,7 +1601,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re
char protocol[128];
GetContactProto(hContact, protocol, sizeof(protocol));
char *contact = GetContactName(hContact, protocol);
- mir_snprintf(buffer, sizeof(buffer), Translate("%s:%s - %d unread events."), contact, protocol, count);
+ mir_snprintf(buffer, SIZEOF(buffer), Translate("%s:%s - %d unread events."), contact, protocol, count);
if (contacts > 0) {
strncat(reply->message, "\n", reply->cMessage);
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
index 2a08772b9e..0513ea98a6 100644
--- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp
+++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
@@ -96,17 +96,17 @@ void saveSettingsConnections(struct CONNECTION *connHead)
while(tmp!=NULL)
{
- mir_snprintf(buff,sizeof(buff), "%dFilterIntIp", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterIntIp", i);
db_set_ts(NULL, PLUGINNAME, buff, tmp->strIntIp);
- mir_snprintf(buff,sizeof(buff), "%dFilterExtIp", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterExtIp", i);
db_set_ts(NULL, PLUGINNAME, buff, tmp->strExtIp);
- mir_snprintf(buff,sizeof(buff), "%dFilterPName", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterPName", i);
db_set_ws(NULL, PLUGINNAME, buff, tmp->PName);
- mir_snprintf(buff,sizeof(buff), "%dFilterIntPort", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterIntPort", i);
db_set_dw(NULL, PLUGINNAME, buff, tmp->intIntPort);
- mir_snprintf(buff,sizeof(buff), "%dFilterExtPort", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterExtPort", i);
db_set_dw(NULL, PLUGINNAME, buff, tmp->intExtPort);
- mir_snprintf(buff,sizeof(buff), "%dFilterAction", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterAction", i);
db_set_dw(NULL, PLUGINNAME, buff, tmp->Pid);
i++;
tmp=tmp->next;
@@ -125,26 +125,26 @@ struct CONNECTION* LoadSettingsConnections()
for(i=settingFiltersCount-1;i>=0;i--)
{
struct CONNECTION *conn=(struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
- mir_snprintf(buff,sizeof(buff), "%dFilterIntIp", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterIntIp", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->strIntIp,dbv.ptszVal,_countof(conn->strIntIp));
db_free(&dbv);
- mir_snprintf(buff,sizeof(buff), "%dFilterExtIp", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterExtIp", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->strExtIp,dbv.ptszVal,_countof(conn->strExtIp));
db_free(&dbv);
- mir_snprintf(buff,sizeof(buff), "%dFilterPName", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterPName", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->PName,dbv.ptszVal,_countof(conn->PName));
db_free(&dbv);
- mir_snprintf(buff,sizeof(buff), "%dFilterIntPort", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterIntPort", i);
conn->intIntPort = db_get_dw(0, PLUGINNAME, buff, -1);
- mir_snprintf(buff,sizeof(buff), "%dFilterExtPort", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterExtPort", i);
conn->intExtPort = db_get_dw(0, PLUGINNAME, buff, -1);
- mir_snprintf(buff,sizeof(buff), "%dFilterAction", i);
+ mir_snprintf(buff,SIZEOF(buff), "%dFilterAction", i);
conn->Pid = db_get_dw(0, PLUGINNAME, buff, 0);
conn->next = connHead;
@@ -168,7 +168,7 @@ void LoadSettings()
for(int i = 0; i < STATUS_COUNT; i++)
{
char buff[128];
- mir_snprintf(buff,sizeof(buff), "Status%d", i);
+ mir_snprintf(buff,SIZEOF(buff), "Status%d", i);
settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
}
//lookupLotusDefaultSettings();
@@ -896,15 +896,15 @@ extern "C" int __declspec(dllexport) Load(void)
for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact,PLUGINNAME))
db_set_w(hContact,PLUGINNAME,"status",ID_STATUS_OFFLINE);
- mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_GETCAPS);
+ mir_snprintf(service,SIZEOF(service), "%s%s", PLUGINNAME, PS_GETCAPS);
CreateServiceFunction(service, GetCaps);
- mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_GETNAME);
+ mir_snprintf(service,SIZEOF(service), "%s%s", PLUGINNAME, PS_GETNAME);
CreateServiceFunction(service, GetName);
- mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_LOADICON);
+ mir_snprintf(service,SIZEOF(service), "%s%s", PLUGINNAME, PS_LOADICON);
CreateServiceFunction(service, TMLoadIcon);
- mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_SETSTATUS);
+ mir_snprintf(service,SIZEOF(service), "%s%s", PLUGINNAME, PS_SETSTATUS);
CreateServiceFunction(service, SetStatus);
- mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_GETSTATUS);
+ mir_snprintf(service,SIZEOF(service), "%s%s", PLUGINNAME, PS_GETSTATUS);
CreateServiceFunction(service, GetStatus);
diff --git a/plugins/CountryFlags/src/utils.cpp b/plugins/CountryFlags/src/utils.cpp
index ed6e455364..e9786cad1d 100644
--- a/plugins/CountryFlags/src/utils.cpp
+++ b/plugins/CountryFlags/src/utils.cpp
@@ -70,7 +70,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT msg,UINT_PTR idTimer,DWORD
callList=NULL;
}
#ifdef _DEBUG
- mir_snprintf(szDbgLine,sizeof(szDbgLine),"buffered call: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
+ mir_snprintf(szDbgLine,SIZEOF(szDbgLine),"buffered call: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
OutputDebugStringA(szDbgLine);
#endif
CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc,(void*)lParam); /* compatible */
@@ -83,7 +83,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT msg,UINT_PTR idTimer,DWORD
/* set next timer */
if (nCallListCount) {
#ifdef _DEBUG
- mir_snprintf(szDbgLine,sizeof(szDbgLine),"next buffered timeout: %ums\n",uElapseNext); /* all ascii */
+ mir_snprintf(szDbgLine,SIZEOF(szDbgLine),"next buffered timeout: %ums\n",uElapseNext); /* all ascii */
OutputDebugStringA(szDbgLine);
#endif
idBufferedTimer=SetTimer(hwnd,idBufferedTimer,uElapseNext,BufferedProcTimer); /* will be reset */
@@ -130,10 +130,10 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
#ifdef _DEBUG
{ char szDbgLine[256];
data->pszProcName=pszProcName;
- mir_snprintf(szDbgLine,sizeof(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
+ mir_snprintf(szDbgLine,SIZEOF(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
OutputDebugStringA(szDbgLine);
if (!idBufferedTimer) {
- mir_snprintf(szDbgLine,sizeof(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */
+ mir_snprintf(szDbgLine,SIZEOF(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */
OutputDebugStringA(szDbgLine);
}
}
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp
index 9aaebfe4d7..7b1d2350aa 100644
--- a/plugins/CrashDumper/src/upload.cpp
+++ b/plugins/CrashDumper/src/upload.cpp
@@ -67,8 +67,8 @@ void OpenAuthUrl(const char* url)
if (user[0] && pass[0]) {
char str[256];
- mir_snprintf(str, sizeof(str), url, user);
- mir_snprintf(str, sizeof(str), "http://vi.miranda-ng.org/detail/%s", user);
+ mir_snprintf(str, SIZEOF(str), url, user); // XXX: fix me
+ mir_snprintf(str, SIZEOF(str), "http://vi.miranda-ng.org/detail/%s", user);
CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)str);
}
else CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)"http://vi.miranda-ng.org/");
@@ -80,7 +80,7 @@ void CreateAuthString(char* auth)
GetLoginStr(user, sizeof(user), pass);
char str[110];
- int len = mir_snprintf(str, sizeof(str), "%s:%s", user, pass);
+ int len = mir_snprintf(str, SIZEOF(str), "%s:%s", user, pass);
mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode((PBYTE)str, len)));
}
@@ -203,7 +203,7 @@ void __cdecl VersionInfoUploadThread(void* arg)
char user[64], pass[40];
GetLoginStr(user, sizeof(user), pass);
char str[256];
- mir_snprintf(str, sizeof(str), "http://vi.miranda-ng.org/en/upload?login=%s&pass=%s", user, pass);
+ mir_snprintf(str, SIZEOF(str), "http://vi.miranda-ng.org/en/upload?login=%s&pass=%s", user, pass);
InternetDownloadFile(str, trn);
mir_free(trn->buf);
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp
index 47b12b2c70..7a99d7fe3a 100644
--- a/plugins/Db3x_mmap/src/database.cpp
+++ b/plugins/Db3x_mmap/src/database.cpp
@@ -130,13 +130,13 @@ char* printVariant(DBVARIANT* p)
static char boo[1000];
switch (p->type) {
- case DBVT_BYTE: mir_snprintf(boo, sizeof(boo), "byte: %d", p->bVal ); break;
- case DBVT_WORD: mir_snprintf(boo, sizeof(boo), "word: %d", p->wVal ); break;
- case DBVT_DWORD: mir_snprintf(boo, sizeof(boo), "dword: %d", p->dVal ); break;
+ case DBVT_BYTE: mir_snprintf(boo, SIZEOF(boo), "byte: %d", p->bVal ); break;
+ case DBVT_WORD: mir_snprintf(boo, SIZEOF(boo), "word: %d", p->wVal ); break;
+ case DBVT_DWORD: mir_snprintf(boo, SIZEOF(boo), "dword: %d", p->dVal ); break;
case DBVT_UTF8:
- case DBVT_ASCIIZ: mir_snprintf(boo, sizeof(boo), "string: '%s'", p->pszVal); break;
+ case DBVT_ASCIIZ: mir_snprintf(boo, SIZEOF(boo), "string: '%s'", p->pszVal); break;
case DBVT_DELETED: strcpy(boo, "deleted"); break;
- default: mir_snprintf(boo, sizeof(boo), "crap: %d", p->type ); break;
+ default: mir_snprintf(boo, SIZEOF(boo), "crap: %d", p->type ); break;
}
return boo;
}
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp
index cecd5f85b0..9d65790c8c 100644
--- a/plugins/Db3x_mmap/src/dbcontacts.cpp
+++ b/plugins/Db3x_mmap/src/dbcontacts.cpp
@@ -414,7 +414,7 @@ void CDb3Mmap::FillContacts()
cc->pSubs = (MCONTACT*)mir_alloc(cc->nSubs*sizeof(MCONTACT));
for (int i = 0; i < cc->nSubs; i++) {
char setting[100];
- mir_snprintf(setting, sizeof(setting), "Handle%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "Handle%d", i);
cc->pSubs[i] = (0 != GetContactSetting(dwContactID, META_PROTO, setting, &dbv)) ? NULL : dbv.dVal;
}
}
@@ -452,7 +452,7 @@ void CDb3Mmap::FillContacts()
ccMeta->pSubs[dbv.dVal] = hh;
char setting[100];
- mir_snprintf(setting, sizeof(setting), "Handle%d", dbv.dVal);
+ mir_snprintf(setting, SIZEOF(setting), "Handle%d", dbv.dVal);
dbws.szSetting = setting;
dbws.value.dVal = hh;
WriteContactSetting(ccMeta->contactID, &dbws);
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index 1a5bc9c64c..d3577920e8 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -3,7 +3,7 @@
HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASERVICEOBJ serviceProc, void *obj)
{
char str[MAXMODULELABELLENGTH];
- mir_snprintf(str, sizeof(str), "%s%s", MODULE, szService);
+ mir_snprintf(str, SIZEOF(str), "%s%s", MODULE, szService);
str[MAXMODULELABELLENGTH - 1] = 0;
return CreateServiceFunctionObj(str, serviceProc, obj);
}
diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp
index 8d0447c398..a5310c82d6 100644
--- a/plugins/FTPFileYM/src/job_delete.cpp
+++ b/plugins/FTPFileYM/src/job_delete.cpp
@@ -105,9 +105,9 @@ void DeleteJob::run()
char *DeleteJob::getDelFileString()
{
if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, sizeof(buff), "rm \"%s/%s\"", ftp->szDir, entry->szFileName);
+ mir_snprintf(buff, SIZEOF(buff), "rm \"%s/%s\"", ftp->szDir, entry->szFileName);
else
- mir_snprintf(buff, sizeof(buff), "DELE %s", entry->szFileName);
+ mir_snprintf(buff, SIZEOF(buff), "DELE %s", entry->szFileName);
return buff;
}
@@ -115,9 +115,9 @@ char *DeleteJob::getDelFileString()
char *DeleteJob::getDelUrlString()
{
if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH)
- mir_snprintf(buff, sizeof(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
+ mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
else
- mir_snprintf(buff, sizeof(buff), "%s%s/", ftp->getProtoString(), ftp->szServer);
+ mir_snprintf(buff, SIZEOF(buff), "%s%s/", ftp->getProtoString(), ftp->szServer);
return buff;
} \ No newline at end of file
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index abe8240f93..0171f8ae8d 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -182,9 +182,9 @@ void UploadJob::start()
char *UploadJob::getChmodString()
{
if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, sizeof(buff), "%s \"%s/%s\"", ftp->szChmod, ftp->szDir, this->szSafeFileName);
+ mir_snprintf(buff, SIZEOF(buff), "%s \"%s/%s\"", ftp->szChmod, ftp->szDir, this->szSafeFileName);
else
- mir_snprintf(buff, sizeof(buff), "%s %s", ftp->szChmod, this->szSafeFileName);
+ mir_snprintf(buff, SIZEOF(buff), "%s %s", ftp->szChmod, this->szSafeFileName);
return buff;
}
@@ -192,9 +192,9 @@ char *UploadJob::getChmodString()
char *UploadJob::getDelFileString()
{
if (ftp->ftpProto == ServerList::FTP::FT_SSH)
- mir_snprintf(buff, sizeof(buff), "rm \"%s/%s\"", ftp->szDir, this->szSafeFileName);
+ mir_snprintf(buff, SIZEOF(buff), "rm \"%s/%s\"", ftp->szDir, this->szSafeFileName);
else
- mir_snprintf(buff, sizeof(buff), "DELE %s", this->szSafeFileName);
+ mir_snprintf(buff, SIZEOF(buff), "DELE %s", this->szSafeFileName);
return buff;
}
@@ -202,9 +202,9 @@ char *UploadJob::getDelFileString()
char *UploadJob::getUrlString()
{
if (ftp->szDir[0])
- mir_snprintf(buff, sizeof(buff), "%s%s/%s/%s", ftp->getProtoString(), ftp->szServer, ftp->szDir, this->szSafeFileName);
+ mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/%s", ftp->getProtoString(), ftp->szServer, ftp->szDir, this->szSafeFileName);
else
- mir_snprintf(buff, sizeof(buff), "%s%s/%s", ftp->getProtoString(), ftp->szServer, this->szSafeFileName);
+ mir_snprintf(buff, SIZEOF(buff), "%s%s/%s", ftp->getProtoString(), ftp->szServer, this->szSafeFileName);
return buff;
}
@@ -212,9 +212,9 @@ char *UploadJob::getUrlString()
char *UploadJob::getDelUrlString()
{
if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH)
- mir_snprintf(buff, sizeof(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
+ mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir);
else
- mir_snprintf(buff, sizeof(buff), "%s%s/", ftp->getProtoString(), ftp->szServer);
+ mir_snprintf(buff, SIZEOF(buff), "%s%s/", ftp->getProtoString(), ftp->szServer);
return buff;
}
@@ -316,7 +316,7 @@ void UploadJob::upload()
if (result != CURLE_OK && result != CURLE_ABORTED_BY_CALLBACK) {
char buff[256];
- mir_snprintf(buff, sizeof(buff), Translate("FTP error occurred.\n%s"), this->szError);
+ mir_snprintf(buff, SIZEOF(buff), Translate("FTP error occurred.\n%s"), this->szError);
Utils::msgBoxA(buff, MB_OK | MB_ICONERROR);
}
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp
index 9db3710d17..7e5fa09bae 100644
--- a/plugins/FTPFileYM/src/manager.cpp
+++ b/plugins/FTPFileYM/src/manager.cpp
@@ -83,7 +83,7 @@ void Manager::initImageList()
for (int i = 0; i < ServerList::FTP_COUNT; i++)
{
- mir_snprintf(buff, sizeof(buff), "ftp%d", i);
+ mir_snprintf(buff, SIZEOF(buff), "ftp%d", i);
ImageList_AddIcon(himlStates, Utils::loadIconEx(buff));
}
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp
index dedd8dc256..79057d2aab 100644
--- a/plugins/FTPFileYM/src/mir_db.cpp
+++ b/plugins/FTPFileYM/src/mir_db.cpp
@@ -21,56 +21,56 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
int DB::setByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_set_b(hContact, szModule, formSet, iValue);
}
int DB::setWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_set_w(hContact, szModule, formSet, iValue);
}
int DB::setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_set_dw(hContact, szModule, formSet, iValue);
}
int DB::setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_set_s(hContact, szModule, formSet, szValue);
}
int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_set_ts(hContact, szModule, formSet, stzValue);
}
int DB::getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_get_b(hContact, szModule, formSet, iErrorValue);
}
int DB::getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_get_w(hContact, szModule, formSet, iErrorValue);
}
int DB::getDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_get_dw(hContact, szModule, formSet, iErrorValue);
}
@@ -91,7 +91,7 @@ int DB::getAString(MCONTACT hContact, char *szModule, char *szSetting, char *buf
int DB::getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *buff)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return getAString(hContact, szModule, formSet, buff);
}
@@ -112,13 +112,13 @@ int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buf
int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return getString(hContact, szModule, formSet, buff);
}
int DB::deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id)
{
char formSet[256];
- mir_snprintf(formSet, sizeof(formSet), szSetting, id);
+ mir_snprintf(formSet, SIZEOF(formSet), szSetting, id);
return db_unset(hContact, szModule, formSet);
}
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp
index d199228675..5b7d5396ad 100644
--- a/plugins/FTPFileYM/src/serverlist.cpp
+++ b/plugins/FTPFileYM/src/serverlist.cpp
@@ -45,7 +45,7 @@ void ServerList::saveToDb() const
ServerList::FTP *ftp = ftpList.getSelected();
char buff[256];
- mir_snprintf(buff, sizeof(buff), "Password%d", opt.selected);
+ mir_snprintf(buff, SIZEOF(buff), "Password%d", opt.selected);
DB::setAStringF(0, MODULE, buff, opt.selected, ftp->szPass);
DB::setStringF(0, MODULE, "Name%d", opt.selected, ftp->stzName);
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp
index e824e35e7e..ed31daf5ff 100644
--- a/plugins/FTPFileYM/src/utils.cpp
+++ b/plugins/FTPFileYM/src/utils.cpp
@@ -48,7 +48,7 @@ int Utils::msgBoxA(char *szMsg, UINT uType)
HICON Utils::loadIconEx(char *szName)
{
char buff[100];
- mir_snprintf(buff, sizeof(buff), "%s_%s", MODULE, szName);
+ mir_snprintf(buff, SIZEOF(buff), "%s_%s", MODULE, szName);
return Skin_GetIcon(buff);
}
@@ -139,7 +139,7 @@ void Utils::curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl
else
curl_easy_setopt(hCurl, CURLOPT_FTPPORT, "-");
- mir_snprintf(buff, sizeof(buff), "%s:%s", ftp->szUser, ftp->szPass);
+ mir_snprintf(buff, SIZEOF(buff), "%s:%s", ftp->szUser, ftp->szPass);
curl_easy_setopt(hCurl, CURLOPT_USERPWD, buff);
if (ftp->ftpProto == ServerList::FTP::FT_SSL_EXPLICIT || ftp->ftpProto == ServerList::FTP::FT_SSL_IMPLICIT)
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index 26394fa7b8..21aa2775ba 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -260,9 +260,9 @@ void FILEECHO::updateTitle()
contactName=(char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,0);
if(iState == STATE_OPERATE && chunkCount != 0)
- mir_snprintf(newtitle, sizeof(newtitle), "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName);
+ mir_snprintf(newtitle, SIZEOF(newtitle), "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName);
else
- mir_snprintf(newtitle, sizeof(newtitle), "%s: %s", Translate(szFEMode[inSend]), contactName);
+ mir_snprintf(newtitle, SIZEOF(newtitle), "%s: %s", Translate(szFEMode[inSend]), contactName);
SetWindowText(hDlg, newtitle);
}
@@ -429,9 +429,9 @@ void FILEECHO::sendReq()
if(*p == '\\')
strcpy(filename,p+1);
- mir_snprintf(sendbuf, sizeof(sendbuf), Translate("Size: %d bytes"), fileSize);
+ mir_snprintf(sendbuf, SIZEOF(sendbuf), Translate("Size: %d bytes"), fileSize);
SetDlgItemText(hDlg, IDC_FILESIZE, sendbuf);
- mir_snprintf(sendbuf, sizeof(sendbuf), "?%c%c%d:%d \n" NOPLUGIN_MESSAGE, asBinary+'0', codeSymb, chunkCount, fileSize);
+ mir_snprintf(sendbuf, SIZEOF(sendbuf), "?%c%c%d:%d \n" NOPLUGIN_MESSAGE, asBinary+'0', codeSymb, chunkCount, fileSize);
sendCmd(0, CMD_REQ, sendbuf, filename);
SetDlgItemText(hDlg, IDC_STATUS, Translate("Request sent. Awaiting of acceptance.."));
@@ -460,7 +460,7 @@ void FILEECHO::incomeRequest(char *param)
chunkCountx = atoi(p);
fileSize = atoi(param);
- mir_snprintf(buf, sizeof(buf), Translate("Size: %d bytes"), fileSize);
+ mir_snprintf(buf, SIZEOF(buf), Translate("Size: %d bytes"), fileSize);
SetDlgItemText(hDlg, IDC_FILENAME, filename);
SetDlgItemText(hDlg, IDC_FILESIZE, buf);
@@ -635,7 +635,7 @@ void FILEECHO::onSendTimer()
}
char prefix[128];
- mir_snprintf(prefix, sizeof(prefix), "%X,%X,%X>", chunkIndx+1, chunkPos[chunkIndx], chksum);
+ mir_snprintf(prefix, SIZEOF(prefix), "%X,%X,%X>", chunkIndx+1, chunkPos[chunkIndx], chksum);
#ifdef DEBUG
overhead += mir_tstrlen((char*)buffer);
#endif
@@ -1189,9 +1189,9 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
int size = RetrieveFileSize(str);
if(size != -1)
- mir_snprintf(str, sizeof(str), Translate("Size: %d bytes"), size);
+ mir_snprintf(str, SIZEOF(str), Translate("Size: %d bytes"), size);
else
- mir_snprintf(str, sizeof(str), Translate("Can't get a file size"), size);
+ mir_snprintf(str, SIZEOF(str), "%s", Translate("Can't get a file size"));
SetDlgItemText(hDlg, IDC_FILESIZE, str);
break;
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index e6e656197d..53334e5b9b 100644
--- a/plugins/HTTPServer/src/GuiElements.cpp
+++ b/plugins/HTTPServer/src/GuiElements.cpp
@@ -201,7 +201,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) {
string sCreateLink(const char * pszSrvPath) {
char szTemp[30];
string sLink = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName);
- mir_snprintf(szTemp, sizeof(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
ReplaceAll(sLink, "%LocalIP%", szTemp);
if (sLink.find("%ExternalIP%") != sLink.npos) {
@@ -214,11 +214,11 @@ string sCreateLink(const char * pszSrvPath) {
dwExternalIpAddressGenerated = GetTickCount();
}
- mir_snprintf(szTemp, sizeof(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
ReplaceAll(sLink, "%ExternalIP%", szTemp);
}
- mir_snprintf(szTemp, sizeof(szTemp), "%d", dwLocalPortUsed, szTemp);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%d", dwLocalPortUsed, szTemp);
ReplaceAll(sLink, "%Port%", szTemp);
string sSrvPath = pszSrvPath;
@@ -463,7 +463,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) {
DWORD dwError = CommDlgExtendedError();
if (dwError) {
char szTemp[200];
- mir_snprintf(szTemp, sizeof(szTemp), "Failed to create File Open dialog the error returned was %d", dwError);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "Failed to create File Open dialog the error returned was %d", dwError);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
}
return false;
@@ -560,7 +560,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) {
ListView_InsertItem(hShareList, &sItem);
- mir_snprintf(szTmp, sizeof(szTmp), "%d", pclCur->st.nMaxDownloads);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d", pclCur->st.nMaxDownloads);
sItem.iSubItem = 1;
sItem.pszText = szTmp;
ListView_SetItem(hShareList, &sItem);
@@ -600,7 +600,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) {
ListView_SetItem(hUserList, &sItem);
if (pclCurUser->dwTotalSize) {
- mir_snprintf(szTmp, sizeof(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
} else {
strcpy(szTmp, "? %%");
}
@@ -612,9 +612,9 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) {
if (dwSpeed > 10000) {
dwSpeed += 512; // make sure we round ot down correctly.
dwSpeed /= 1024;
- mir_snprintf(szTmp, sizeof(szTmp), "%d KB/Sec", dwSpeed);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d KB/Sec", dwSpeed);
} else {
- mir_snprintf(szTmp, sizeof(szTmp), "%d B/Sec", dwSpeed);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d B/Sec", dwSpeed);
}
sItem.iSubItem = 4;
sItem.pszText = szTmp;
@@ -1218,7 +1218,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemText(hwndDlg, IDC_PAGE_KEYWORD, szKeyWord, SIZEOF(szKeyWord));
DWORD dwExternalIP = GetExternIP(szUrl, szKeyWord);
- mir_snprintf(szKeyWord, sizeof(szKeyWord), Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
+ mir_snprintf(szKeyWord, SIZEOF(szKeyWord), Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
SplitIpAddress(dwExternalIP) ,
szUrl);
MessageBox(hwndDlg, szKeyWord, MSG_BOX_TITEL, MB_OK);
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp
index 428a5cb087..ee196fbcb5 100644
--- a/plugins/HTTPServer/src/HttpUser.cpp
+++ b/plugins/HTTPServer/src/HttpUser.cpp
@@ -231,7 +231,7 @@ void CLHttpUser::SendError(int iErrorCode, const char * pszError, const char * p
pszDescription = pszError;
char szBuf[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf),
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf),
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -281,7 +281,7 @@ void CLHttpUser::SendRedir(int iErrorCode, const char * pszError, const char * p
pszDescription = pszError;
char szBuff[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuff, sizeof(szBuff),
+ DWORD dwBytesToWrite = mir_snprintf(szBuff, SIZEOF(szBuff),
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -546,7 +546,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) {
char szETag[ 50 ];
{
- int nETagLen = mir_snprintf(szETag, sizeof(szETag), "\"%x-%x-%x\"",
+ int nETagLen = mir_snprintf(szETag, SIZEOF(szETag), "\"%x-%x-%x\"",
nDataSize, stFileTime.dwHighDateTime, stFileTime.dwLowDateTime);
if (!apszParam[eIfRange] || (strncmp(szETag, apszParam[eIfRange], nETagLen) == 0)) {
@@ -616,7 +616,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) {
"Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpPartial,
+ dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf), szHttpPartial,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
@@ -638,7 +638,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) {
"Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpOk,
+ dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf), szHttpOk,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index 11c1350bc8..5c289bbb75 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -345,7 +345,7 @@ bool bWriteConfigurationFile() {
} else {
CLFileShareNode * pclCur = pclFirstNode;
while (pclCur) {
- DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szXmlData ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf), szXmlData ,
pclCur->st.pszSrvPath,
pclCur->pszOrigRealPath,
pclCur->st.nMaxDownloads,
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index 8970fe672c..fb3714240f 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -62,7 +62,7 @@ void InitIcons(void)
HICON LoadIconEx(const char* name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", ModuleName, name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", ModuleName, name);
return Skin_GetIcon(szSettingName);
}
@@ -78,7 +78,7 @@ HANDLE GetIconHandle(const char* name)
void ReleaseIconEx(const char* name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", ModuleName, name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", ModuleName, name);
Skin_ReleaseIcon(szSettingName);
}
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp
index 654751ff21..3bc97efae4 100644
--- a/plugins/IEView/src/HTMLBuilder.cpp
+++ b/plugins/IEView/src/HTMLBuilder.cpp
@@ -219,11 +219,11 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
switch (ci.type) {
case CNFT_ASCIIZ:
- mir_snprintf(buf, sizeof(buf), "%s", ci.pszVal);
+ mir_snprintf(buf, SIZEOF(buf), "%s", ci.pszVal);
mir_free(ci.pszVal);
break;
case CNFT_DWORD:
- mir_snprintf(buf, sizeof(buf), "%u", ci.dVal);
+ mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
break;
}
}
@@ -233,11 +233,11 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
switch (ci.type) {
case CNFT_ASCIIZ:
- mir_snprintf(buf, sizeof(buf), "%s", ci.pszVal);
+ mir_snprintf(buf, SIZEOF(buf), "%s", ci.pszVal);
mir_free(ci.pszVal);
break;
case CNFT_DWORD:
- mir_snprintf(buf, sizeof(buf), "%u", ci.dVal);
+ mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
break;
}
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 9caea5cd99..8b21e14214 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -504,7 +504,7 @@ BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
else
{
char setting[256];
- mir_snprintf(setting, sizeof(setting), "%sEnabled", proto);
+ mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto);
return (BOOL) db_get_b(NULL, MODULE_NAME, setting, FALSE);
}
}
@@ -726,7 +726,7 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled)
return 0;
char setting[256];
- mir_snprintf(setting, sizeof(setting), "%sEnabled", proto);
+ mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto);
db_set_b(NULL, MODULE_NAME, setting, enabled);
// Modify menu info
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index c774f5480c..3e4b9c0c1f 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -434,7 +434,7 @@ void UpdateCheckboxesState(CCList *CList)
HICON g_LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", "", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", "", name);
return Skin_GetIcon(szSettingName, big);
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index d366d209ea..0356a5cab3 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -86,7 +86,7 @@ BYTE GetGender(MCONTACT hContact)
HANDLE GetIconHandle(char *szIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", MODULE, szIcon);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, szIcon);
return Skin_GetIconHandle(szSettingName);
}
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index 2dbaec1fba..06f9ec8396 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -642,7 +642,7 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName)
char szShort[MAX_PATH];
char s[512];
GetShortPathNameA(szFull, szShort, sizeof(szShort));
- mir_snprintf(s, sizeof(s), "play \"%s\"", szShort);
+ mir_snprintf(s, SIZEOF(s), "play \"%s\"", szShort);
mciSendStringA(s, NULL, 0, NULL);
}
@@ -1086,35 +1086,35 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
wCurHour = tm2.wHour;
wCurMinute = tm2.wMinute;
- mir_snprintf(s, sizeof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 5 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, sizeof(s), "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 10 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, sizeof(s), "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 15 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, sizeof(s), "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 30 minutes
li.QuadPart += (ULONGLONG)15 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, sizeof(s), "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
@@ -1142,13 +1142,13 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S
}
// icq-style display 1.0, 1.5 etc. hours even though that isn't accurate due to rounding
- //mir_snprintf(s, sizeof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
+ //mir_snprintf(s, SIZEOF(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
// display delta time more accurately to match reformatting (that icq doesn't do)
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(s, sizeof(s), "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
else
- mir_snprintf(s, sizeof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDTime,CB_SETITEMDATA,n, (LPARAM)(dt*60));
@@ -1179,39 +1179,39 @@ static void PopulateTimeOffsetCombo(HWND Dialog, UINT nIDCombo)
// 5 - 55 minutes (in 5 minute steps)
for (i = 1; i < 12; i++)
{
- mir_snprintf(s, sizeof(s), "%d %s", i*5, lpszMinutes);
+ mir_snprintf(s, SIZEOF(s), "%d %s", i*5, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(i*5));
}
// 1 hour
- mir_snprintf(s, sizeof(s), "1 %s", lpszHour);
+ mir_snprintf(s, SIZEOF(s), "1 %s", lpszHour);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)60);
// 2, 4, 8 hours
for (i = 2; i <= 8; i+=2)
{
- mir_snprintf(s, sizeof(s), "%d %s", i, lpszHours);
+ mir_snprintf(s, SIZEOF(s), "%d %s", i, lpszHours);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(i*60));
}
// 1 day
- mir_snprintf(s, sizeof(s), "1 %s", lpszDay);
+ mir_snprintf(s, SIZEOF(s), "1 %s", lpszDay);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(24*60));
// 2-4 days
for (i = 2; i <= 4; i++)
{
- mir_snprintf(s, sizeof(s), "%d %s", i, lpszDays);
+ mir_snprintf(s, SIZEOF(s), "%d %s", i, lpszDays);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(i*24*60));
}
// 1 week
- mir_snprintf(s, sizeof(s), "1 %s", lpszWeek);
+ mir_snprintf(s, SIZEOF(s), "1 %s", lpszWeek);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(7*24*60));
}
@@ -1257,9 +1257,9 @@ static int ReformatTimeInputEx(HWND Dialog, UINT nIDTime, UINT nIDRefTime, int h
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(buf, sizeof(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
+ mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
else
- mir_snprintf(buf, sizeof(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
+ mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
// search for preset
n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf);
@@ -1368,9 +1368,9 @@ output_result:
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(buf, sizeof(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
+ mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes"));
else
- mir_snprintf(buf, sizeof(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
+ mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours"));
}
}
else
@@ -1938,7 +1938,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA
{
int n;
char s[32];
- mir_snprintf(s, sizeof(s), "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
+ mir_snprintf(s, SIZEOF(s), "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
// search for preset first
n = SendDlgItemMessage(Dialog, IDC_TIME, CB_FINDSTRING, (WPARAM)-1, (LPARAM)s);
@@ -1966,33 +1966,33 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA
n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)Translate("Never"));
SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_SETITEMDATA, n, 0);
- mir_snprintf(s, sizeof(s), "%s 5 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s 5 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)5);
- mir_snprintf(s, sizeof(s), "%s 10 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s 10 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)10);
- mir_snprintf(s, sizeof(s), "%s 15 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s 15 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)15);
- mir_snprintf(s, sizeof(s), "%s 20 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s 20 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)20);
- mir_snprintf(s, sizeof(s), "%s 30 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s 30 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)30);
- mir_snprintf(s, sizeof(s), "%s 60 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s 60 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)60);
if (NewReminderVisible == 2 && pEditReminder->RepeatSound)
{
- mir_snprintf(s, sizeof(s), "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
+ mir_snprintf(s, SIZEOF(s), "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
SetDlgItemText(Dialog, IDC_COMBO_REPEATSND, s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETCURSEL, SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)s), 0);
}
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index 6d460bc5f2..3ff8b7e8cb 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -199,8 +199,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
void LoadProtocols(void)
{
//Load the default nudge
- mir_snprintf(DefaultNudge.ProtocolName, sizeof(DefaultNudge.ProtocolName), "Default");
- mir_snprintf(DefaultNudge.NudgeSoundname, sizeof(DefaultNudge.NudgeSoundname), "Nudge : Default");
+ mir_snprintf(DefaultNudge.ProtocolName, SIZEOF(DefaultNudge.ProtocolName), "Default");
+ mir_snprintf(DefaultNudge.NudgeSoundname, SIZEOF(DefaultNudge.NudgeSoundname), "Nudge : Default");
SkinAddNewSoundEx(DefaultNudge.NudgeSoundname, LPGEN("Nudge"), LPGEN("Default Nudge"));
DefaultNudge.Load();
@@ -495,7 +495,7 @@ void Nudge_ShowStatus(CNudgeElement n, MCONTACT hContact, DWORD timestamp)
void Nudge_AddAccount(PROTOACCOUNT *proto)
{
char str[MAXMODULELABELLENGTH + 10];
- mir_snprintf(str, sizeof(str), "%s/Nudge", proto->szModuleName);
+ mir_snprintf(str, SIZEOF(str), "%s/Nudge", proto->szModuleName);
HANDLE hevent = HookEvent(str, NudgeReceived);
if (hevent == NULL)
return;
@@ -505,7 +505,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
//Add a specific sound per protocol
NudgeElementList *newNudge = new NudgeElementList;
//newNudge = (NudgeElementList*) malloc(sizeof(NudgeElementList));
- mir_snprintf(newNudge->item.NudgeSoundname, sizeof(newNudge->item.NudgeSoundname), "%s: Nudge", proto->szModuleName);
+ mir_snprintf(newNudge->item.NudgeSoundname, SIZEOF(newNudge->item.NudgeSoundname), "%s: Nudge", proto->szModuleName);
strcpy(newNudge->item.ProtocolName, proto->szProtoName);
_tcscpy(newNudge->item.AccountName, proto->tszAccountName);
@@ -522,7 +522,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
NudgeList = newNudge;
char iconName[MAXMODULELABELLENGTH + 10];
- mir_snprintf(iconName, sizeof(iconName), "Nudge_%s", proto->szModuleName);
+ mir_snprintf(iconName, SIZEOF(iconName), "Nudge_%s", proto->szModuleName);
TCHAR szFilename[MAX_PATH], iconDesc[MAXMODULELABELLENGTH + 10];
GetModuleFileName(hInst, szFilename, MAX_PATH);
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp
index 5a891ce0ac..17437bf80a 100644
--- a/plugins/OpenFolder/src/openFolder.cpp
+++ b/plugins/OpenFolder/src/openFolder.cpp
@@ -64,7 +64,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
HICON LoadIconExEx(const char* IcoLibName, int NonIcoLibIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", OPENFOLDER_MODULE_NAME, IcoLibName);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", OPENFOLDER_MODULE_NAME, IcoLibName);
return Skin_GetIcon(szSettingName);
}
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp
index d481fc63c9..4e821502c4 100644
--- a/plugins/Popup/src/font.cpp
+++ b/plugins/Popup/src/font.cpp
@@ -39,32 +39,32 @@ void InitFonts() {
mir_tstrncpy(fid.deffontsettings.szFace, _T("Tahoma"), SIZEOF(fid.deffontsettings.szFace));
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name));
- mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
+ mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
- mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
+ mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
//fid.deffontsettings.style = DBFONTF_BOLD;
//fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
- mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
+ mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
//fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
- mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
+ mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
//fid.deffontsettings.style = 0;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
- mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
+ mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
//fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h
index eeab5d9f65..8f897600af 100644
--- a/plugins/Popup/src/font.h
+++ b/plugins/Popup/src/font.h
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color
#define PU_FNT_AND_COLOR_DB MODULNAME //use eg strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
-#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
+#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
#define PU_FNT_NAME_TITLE LPGEN("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
#define PU_FNT_NAME_CLOCK LPGEN("Clock")
#define PU_FNT_NAME_TEXT LPGEN("Text")
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index 7223a22100..0008852e25 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -94,32 +94,32 @@ void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
if (ptd->typ == 1) {
char setting[2*MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "{%s/%s}Timeout",
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}Timeout",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_w(NULL, szModul, setting, ptd->notification.iSeconds);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}enabled",
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}enabled",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_b(NULL, szModul, setting, ptd->enabled);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}TimeoutVal",
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}TimeoutVal",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}disableWhen",
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}disableWhen",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_b(NULL, szModul, setting, ptd->disableWhen);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction",
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}leftAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction",
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}rightAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
@@ -141,29 +141,29 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
char setting[2*MAXMODULELABELLENGTH];
char *szTmp = NULL;
- mir_snprintf(setting, sizeof(setting), "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->notification.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, ptd->notification.iSeconds);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
ptd->notification.iSeconds ? ptd->notification.iSeconds : 0);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->disableWhen =
db_get_b(NULL, szModul, setting, 0);
- mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
- mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzRAction);
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -187,7 +187,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
FontID fontid = {0};
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, sizeof(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(fontid.group, SIZEOF(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -202,7 +202,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
ColourID colourid = {0};
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, sizeof(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(colourid.group, SIZEOF(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(colourid.dbSettingsGroup, "PopupNotifications");
mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", notification->lpzName);
mir_snprintf(colourid.setting, SIZEOF(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
@@ -210,8 +210,8 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
ColourRegister(&colourid);
char section[MAXMODULELABELLENGTH], setting[MAXMODULELABELLENGTH];
- mir_snprintf(section, sizeof(section), "Popups/%s", notification->lpzGroup);
- mir_snprintf(setting, sizeof(setting), MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(section, SIZEOF(section), "Popups/%s", notification->lpzGroup);
+ mir_snprintf(setting, SIZEOF(setting), MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = section;
@@ -254,18 +254,18 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen)
LOGFONTA lf; //dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
FontID fontid = {0}; //use ansi version of fontID coz POPUPNOTIFICATION use char
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, sizeof(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(fontid.group, SIZEOF(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", ptd->notification.lpzName);
ppd->colorText = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fontid, (LPARAM)&lf);
ColourID colourid = {0}; //use ansi version of ColourID coz POPUPNOTIFICATION use char
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, sizeof(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(colourid.group, SIZEOF(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", ptd->notification.lpzName);
ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), MODULNAME"_%s_%s", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, SIZEOF(setting), MODULNAME"_%s_%s", ptd->notification.lpzGroup, ptd->notification.lpzName);
ppd->lchIcon = Skin_GetIcon(setting);
}
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index 4fd1d07894..3410671606 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -189,7 +189,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
for (i=0; i < gTreeData.getCount(); ++i) {
switch (gTreeData[i]->typ) {
case 1: //Treeview part for typ 1 (notification)
- mir_snprintf(iconName, sizeof(iconName), "%s_%S_%S", MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
+ mir_snprintf(iconName, SIZEOF(iconName), "%s_%S_%S", MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(iconName));
mir_sntprintf(itemName, SIZEOF(itemName), _T("%s/%s"), gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
break;
@@ -493,25 +493,25 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
char setting[2*MAXMODULELABELLENGTH];
char *szTmp = NULL;
- mir_snprintf(setting, sizeof(setting), "%s/enabled", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
- mir_snprintf(setting, sizeof(setting), "%s/Timeout", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
ptd->pupClass.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, 0);
- mir_snprintf(setting, sizeof(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
- mir_snprintf(setting, sizeof(setting), "%s/leftAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); //standart ??
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
- mir_snprintf(setting, sizeof(setting), "%s/rightAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); //standart ??
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -521,18 +521,18 @@ void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul)
{
char setting[2*MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "%s/enabled", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
db_set_b(NULL, szModul, setting, ptd->enabled);
- mir_snprintf(setting, sizeof(setting), "%s/Timeout", ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->pupClass.iSeconds);
- mir_snprintf(setting, sizeof(setting), "%s/TimeoutVal",ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal",ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, sizeof(setting), "%s/leftAction",ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/leftAction",ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, sizeof(setting), "%s/rightAction",ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/rightAction",ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index c104eb2c3a..5b39304862 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
continue;
char prefix[128];
- mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
+ mir_snprintf(prefix, SIZEOF(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
TCHAR pszSettingName[256];
mir_sntprintf(pszSettingName, SIZEOF(pszSettingName), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index 2edb58f93e..c859e7f620 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -281,7 +281,7 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw
//check "Skin options" state
char prefix[128];
- mir_snprintf(prefix, sizeof(prefix),"skin.%S", PopupOptions.SkinPack);
+ mir_snprintf(prefix, SIZEOF(prefix),"skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index 5c61d32e65..e56281bd37 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -361,7 +361,7 @@ void PopupWnd2::show()
if (*PopupOptions.Effect)
{
char vfxService[128];
- mir_snprintf(vfxService, sizeof(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
+ mir_snprintf(vfxService, SIZEOF(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
if (ServiceExists(vfxService))
if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0))
{
@@ -459,7 +459,7 @@ void PopupWnd2::hide()
if (*PopupOptions.Effect)
{
char vfxService[128];
- mir_snprintf(vfxService, sizeof(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
+ mir_snprintf(vfxService, SIZEOF(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
if (ServiceExists(vfxService))
if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0))
{
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index fe17687cf7..6c2fd14c6d 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -146,7 +146,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam)
if (proto) {
char prefix[128];
- mir_snprintf(prefix, sizeof(prefix), LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
+ mir_snprintf(prefix, SIZEOF(prefix), LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
if (db_get_dw(NULL, MODULNAME, prefix, 0) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
return -1;
if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
@@ -389,7 +389,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
_tcsncpy(fid.deffontsettings.szFace, _T("Verdana"), SIZEOF(fid.deffontsettings.szFace));
_tcsncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
strncpy(fid.prefix, setting, SIZEOF(fid.prefix));
- mir_snprintf(fid.prefix, sizeof(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
+ mir_snprintf(fid.prefix, SIZEOF(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
FontRegisterT(&fid);
@@ -402,7 +402,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
mir_sntprintf(cid.group, SIZEOF(cid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
strncpy(cid.dbSettingsGroup, PU_MODULCLASS, SIZEOF(fid.dbSettingsGroup));
_tcsncpy(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
- mir_snprintf(cid.setting, sizeof(cid.setting), "%s/BgCol", ptd->pupClass.pszName);
+ mir_snprintf(cid.setting, SIZEOF(cid.setting), "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
ColourRegisterT(&cid);
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index 444c539c95..d9010f4af4 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -1047,14 +1047,14 @@ void PopupSkin::freeSkin(SKINELEMENT *head)
void PopupSkin::saveOpts() const
{
char buf[128];
- mir_snprintf(buf, sizeof(buf), "skin.%.120S", m_name);
+ mir_snprintf(buf, SIZEOF(buf), "skin.%.120S", m_name);
db_set_dw(NULL, MODULNAME, buf, m_flags);
}
void PopupSkin::loadOpts() const
{
char buf[128];
- mir_snprintf(buf, sizeof(buf), "skin.%.120S", m_name);
+ mir_snprintf(buf, SIZEOF(buf), "skin.%.120S", m_name);
m_flags = db_get_dw(NULL, MODULNAME, buf, m_flags);
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 3a04330268..3360e861eb 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -361,7 +361,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
{
// See if has to show
char setting[128];
- mir_snprintf(setting, sizeof(setting), "ShowOffline%s", pszProto);
+ mir_snprintf(setting, SIZEOF(setting), "ShowOffline%s", pszProto);
if (!db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
@@ -383,7 +383,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
continue;
char setting[128];
- mir_snprintf(setting, sizeof(setting), "ShowOffline%s", META_PROTO);
+ mir_snprintf(setting, SIZEOF(setting), "ShowOffline%s", META_PROTO);
if (db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
}
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp
index 3a9cc46681..2e2d8ec2b7 100644
--- a/plugins/QuickMessages/src/Utils.cpp
+++ b/plugins/QuickMessages/src/Utils.cpp
@@ -157,22 +157,22 @@ void SaveModuleSettings(int buttonnum,ButtonData* bd)
{
char szMEntry[256]={'\0'};
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryName_%u_%u",buttonnum,bd->dwPos);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryName_%u_%u",buttonnum,bd->dwPos);
db_set_ts(NULL, PLGNAME,szMEntry,bd->pszName );
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryValue_%u_%u",buttonnum,bd->dwPos);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryValue_%u_%u",buttonnum,bd->dwPos);
if(bd->pszValue)
db_set_ts(NULL, PLGNAME,szMEntry,bd->pszValue );
else
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryRel_%u_%u",buttonnum,bd->dwPos);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryRel_%u_%u",buttonnum,bd->dwPos);
db_set_b(NULL, PLGNAME,szMEntry,bd->fEntryType );
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryToQMenu_%u_%u",buttonnum,bd->dwPos);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryToQMenu_%u_%u",buttonnum,bd->dwPos);
db_set_b(NULL, PLGNAME,szMEntry,bd->bInQMenu);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,bd->dwPos);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,bd->dwPos);
db_set_b(NULL, PLGNAME,szMEntry,bd->bIsServName);
}
@@ -181,27 +181,27 @@ void CleanSettings(int buttonnum,int from)
char szMEntry[256]={'\0'};
DBVARIANT dbv = {0};
if(from==-1){
- mir_snprintf(szMEntry,sizeof(szMEntry),"ButtonName_%u",buttonnum);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"ButtonName_%u",buttonnum);
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"ButtonValue_%u",buttonnum);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"ButtonValue_%u",buttonnum);
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"RCEntryIsServiceName_%u",buttonnum);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"RCEntryIsServiceName_%u",buttonnum);
db_unset(NULL, PLGNAME,szMEntry);
}
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryName_%u_%u",buttonnum,from);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryName_%u_%u",buttonnum,from);
while(!db_get_ts(NULL, PLGNAME,szMEntry,&dbv)) {
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryValue_%u_%u",buttonnum,from);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryValue_%u_%u",buttonnum,from);
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryRel_%u_%u",buttonnum,from);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryRel_%u_%u",buttonnum,from);
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryToQMenu_%u_%u",buttonnum,from);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryToQMenu_%u_%u",buttonnum,from);
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,from);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,from);
db_unset(NULL, PLGNAME,szMEntry);
- mir_snprintf(szMEntry,sizeof(szMEntry),"EntryName_%u_%u",buttonnum,++from);
+ mir_snprintf(szMEntry,SIZEOF(szMEntry),"EntryName_%u_%u",buttonnum,++from);
}
db_free(&dbv);
}
@@ -212,16 +212,16 @@ BYTE getEntryByte(int buttonnum,int entrynum,BOOL mode)
switch (mode) {
case 0:
- mir_snprintf(szMEntry, sizeof(szMEntry), "EntryToQMenu_%u_%u", buttonnum, entrynum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "EntryToQMenu_%u_%u", buttonnum, entrynum);
break;
case 1:
- mir_snprintf(szMEntry, sizeof(szMEntry), "EntryRel_%u_%u", buttonnum, entrynum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "EntryRel_%u_%u", buttonnum, entrynum);
break;
case 2:
- mir_snprintf(szMEntry, sizeof(szMEntry), "EntryIsServiceName_%u_%u", buttonnum, entrynum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "EntryIsServiceName_%u_%u", buttonnum, entrynum);
break;
case 3:
- mir_snprintf(szMEntry, sizeof(szMEntry), "RCEntryIsServiceName_%u", buttonnum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "RCEntryIsServiceName_%u", buttonnum);
break;
}
return db_get_b(NULL, PLGNAME, szMEntry, 0);
@@ -343,21 +343,24 @@ void DestructButtonsList()
TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode)
{
TCHAR* buffer = NULL;
- char szMEntry[256] = {'\0'};
- DBVARIANT dbv = {0};
+ char szMEntry[256];
+ DBVARIANT dbv;
switch (mode) {
case 0:
- mir_snprintf(szMEntry, sizeof(szMEntry), "EntryName_%u_%u", buttonnum, entrynum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "EntryName_%u_%u", buttonnum, entrynum);
break;
case 1:
- mir_snprintf(szMEntry, sizeof(szMEntry), "EntryValue_%u_%u", buttonnum, entrynum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "EntryValue_%u_%u", buttonnum, entrynum);
break;
case 2:
- mir_snprintf(szMEntry, sizeof(szMEntry), "ButtonValue_%u", buttonnum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "ButtonValue_%u", buttonnum);
break;
case 3:
- mir_snprintf(szMEntry, sizeof(szMEntry), "ButtonName_%u", buttonnum);
+ mir_snprintf(szMEntry, SIZEOF(szMEntry), "ButtonName_%u", buttonnum);
+ break;
+ default:
+ szMEntry[0] = 0;
break;
}
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp
index 4fa819f0b2..c28ab865a9 100644
--- a/plugins/RemovePersonalSettings/src/rps.cpp
+++ b/plugins/RemovePersonalSettings/src/rps.cpp
@@ -310,7 +310,7 @@ void RemoveProtocolSettings(const char * protocolName)
// Delete it
if (name[0] != '\0') {
- mir_snprintf(moduleName, sizeof(moduleName), "%s%s", protocolName, name);
+ mir_snprintf(moduleName, SIZEOF(moduleName), "%s%s", protocolName, name);
DeleteSettingEx(moduleName, NULL);
}
@@ -451,7 +451,7 @@ void RemoveDirectories()
if (accounts[i]->szModuleName == NULL || accounts[i]->szModuleName[0] == '\0')
continue;
- mir_snprintf(dir, sizeof(dir), "%s%s", gMirandaDir, accounts[i]->szModuleName);
+ mir_snprintf(dir, SIZEOF(dir), "%s%s", gMirandaDir, accounts[i]->szModuleName);
DeleteFileOrFolder(dir);
}
}
@@ -475,7 +475,7 @@ void RemoveDirectories()
// Delete it
if (name[0] != '\0') {
- mir_snprintf(dir, sizeof(dir), "%s%s", gMirandaDir, name);
+ mir_snprintf(dir, SIZEOF(dir), "%s%s", gMirandaDir, name);
DeleteFileOrFolder(dir);
}
@@ -587,14 +587,14 @@ void DeleteFileOrFolder(const char *name)
HANDLE hwnd;
char tmp[MAX_PATH];
- mir_snprintf(tmp, sizeof(tmp), "%s\\*.*", name);
+ mir_snprintf(tmp, SIZEOF(tmp), "%s\\*.*", name);
// Delete files
hwnd = FindFirstFile(tmp, &findData);
if (hwnd != INVALID_HANDLE_VALUE) {
do {
if (strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, "..")) {
- mir_snprintf(tmp, sizeof(tmp), "%s\\%s", name, findData.cFileName);
+ mir_snprintf(tmp, SIZEOF(tmp), "%s\\%s", name, findData.cFileName);
DeleteFileOrFolder(tmp);
}
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
index 28d787b4c3..12090b2ed2 100644
--- a/plugins/SMS/src/SMS_svc.cpp
+++ b/plugins/SMS/src/SMS_svc.cpp
@@ -26,7 +26,7 @@ int LoadModules(void)
HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
char szServiceFunction[MAX_PATH];
- mir_snprintf(szServiceFunction,sizeof(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
+ mir_snprintf(szServiceFunction,SIZEOF(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 300050000;
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp
index 4d40969b44..b26d5fd4c9 100644
--- a/plugins/SMS/src/functions.cpp
+++ b/plugins/SMS/src/functions.cpp
@@ -104,7 +104,7 @@ DWORD GetContactPhonesCountParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszVa
dwRet++;
for (i=0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff,sizeof(szBuff),"%s%ld",lpszValueName,i);
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%ld",lpszValueName,i);
if ( DB_GetStaticStringW(hContact,lpszModule,szBuff,wszPhone,SIZEOF(wszPhone),&dwPhoneSize))
if ( IsPhoneW(wszPhone,dwPhoneSize))
dwRet++;
@@ -144,7 +144,7 @@ BOOL IsContactPhoneParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,
}
for (i=0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff,sizeof(szBuff),"%s%ld",lpszValueName,i);
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%ld",lpszValueName,i);
if ( DB_GetStaticStringW(hContact,lpszModule,szBuff,wszPhoneLocal,SIZEOF(wszPhoneLocal),&dwPhoneSizeLocal)) {
if (IsPhoneW(wszPhoneLocal,dwPhoneSizeLocal)) {
dwPhoneSizeLocal=CopyNumberW(wszPhoneLocal,wszPhoneLocal,dwPhoneSizeLocal);
@@ -447,7 +447,7 @@ void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour)
if (colour)
{
- mir_snprintf(str,sizeof(str),"Font%dCol",i);
+ mir_snprintf(str,SIZEOF(str),"Font%dCol",i);
(*colour)=db_get_dw(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
}
@@ -461,24 +461,24 @@ void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour)
db_free(&dbv);
}
- mir_snprintf(str,sizeof(str),"Font%dSize",i);
+ mir_snprintf(str,SIZEOF(str),"Font%dSize",i);
lf->lfHeight=(char)db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
lf->lfWidth=0;
lf->lfEscapement=0;
lf->lfOrientation=0;
- mir_snprintf(str,sizeof(str),"Font%dSty",i);
+ mir_snprintf(str,SIZEOF(str),"Font%dSty",i);
style=db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
lf->lfWeight=style&FONTF_BOLD?FW_BOLD:FW_NORMAL;
lf->lfItalic=style&FONTF_ITALIC?1:0;
lf->lfUnderline=0;
lf->lfStrikeOut=0;
- mir_snprintf(str,sizeof(str),"Font%dSet",i);
+ mir_snprintf(str,SIZEOF(str),"Font%dSet",i);
lf->lfCharSet=db_get_b(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
lf->lfOutPrecision=OUT_DEFAULT_PRECIS;
lf->lfClipPrecision=CLIP_DEFAULT_PRECIS;
lf->lfQuality=DEFAULT_QUALITY;
lf->lfPitchAndFamily=DEFAULT_PITCH|FF_DONTCARE;
- mir_snprintf(str,sizeof(str),"Font%d",i);
+ mir_snprintf(str,SIZEOF(str),"Font%d",i);
}
}
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp
index 7af503ed9a..d8bbc9b8ce 100644
--- a/plugins/SMS/src/senddlg.cpp
+++ b/plugins/SMS/src/senddlg.cpp
@@ -996,7 +996,7 @@ void AddContactPhonesToComboToListParam(MCONTACT hContact,LPSTR lpszModule,LPSTR
for (i=0;TRUE;i++)
{
- mir_snprintf(szBuff,sizeof(szBuff),"%s%ld",lpszValueName,i);
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%ld",lpszValueName,i);
if (DB_GetStaticStringW(hContact,lpszModule,szBuff,tszPhoneRaw,SIZEOF(tszPhoneRaw),&dwPhoneSize))
{
tszPhone[0]='+';
@@ -1063,7 +1063,7 @@ void AddContactPhonesToTreeViewParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lp
for (i=0;TRUE;i++)
{
- mir_snprintf(szBuff,sizeof(szBuff),"%s%ld",lpszValueName,i);
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%ld",lpszValueName,i);
if (DB_GetStaticStringW(hContact,lpszModule,szBuff,tszPhoneRaw,SIZEOF(tszPhoneRaw),&dwPhoneSize))
{
tszPhone[0]='+';
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 10f588a8a8..0ee6d0c7d5 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -1079,7 +1079,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char idbuf[128], buf[128];
GetContactUniqueId(dat, idbuf, sizeof(idbuf));
- mir_snprintf(buf, sizeof(buf), Translate("User Menu - %s"), idbuf);
+ mir_snprintf(buf, SIZEOF(buf), Translate("User Menu - %s"), idbuf);
SendMessage(GetDlgItem(hwndDlg, IDC_USERMENU), BUTTONADDTOOLTIP, (WPARAM) buf, 0);
if (!cws || (!strcmp(cws->szModule, dat->szProto) && !strcmp(cws->szSetting, "Status")))
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp
index a147197d6a..e199759257 100644
--- a/plugins/SimpleStatusMsg/src/utils.cpp
+++ b/plugins/SimpleStatusMsg/src/utils.cpp
@@ -42,7 +42,7 @@ void IconsInit(void)
HICON LoadIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "SimpleStatusMsg_%s", name);
return Skin_GetIcon(szSettingName);
}
@@ -58,14 +58,14 @@ HANDLE GetIconHandle(int iconId)
void ReleaseIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "SimpleStatusMsg_%s", name);
Skin_ReleaseIcon(szSettingName);
}
HANDLE HookProtoEvent(const char *szModule, const char *szEvent, MIRANDAHOOKPARAM hookProc)
{
char szProtoEvent[MAXMODULELABELLENGTH];
- mir_snprintf(szProtoEvent, sizeof(szProtoEvent), "%s%s", szModule, szEvent);
+ mir_snprintf(szProtoEvent, SIZEOF(szProtoEvent), "%s%s", szModule, szEvent);
HANDLE res = HookEventParam(szProtoEvent, hookProc, (LPARAM)szModule);
arProtoHooks.insert(res);
return res;
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 8a1947424c..6b12dbd0de 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -189,7 +189,7 @@ void SmileyType::CallSmileyService(MCONTACT hContact)
proto = (const char*)GetContactProto(hContact);
if (proto == NULL) return;
}
- mir_snprintf(str, sizeof(str), "%s%s", proto, T2A_SM(name.c_str()));
+ mir_snprintf(str, SIZEOF(str), "%s%s", proto, T2A_SM(name.c_str()));
CallService(str,
ConvertServiceParam(hContact, par1.c_str()),
ConvertServiceParam(hContact, par2.c_str()));
@@ -839,7 +839,7 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr
packnam = "MSN";
char path[MAX_PATH];
- mir_snprintf(path, sizeof(path), "Smileys\\nova\\%s.msl", packnam);
+ mir_snprintf(path, SIZEOF(path), "Smileys\\nova\\%s.msl", packnam);
CMString paths = A2T_SM(path), patha;
pathToAbsolute(paths, patha);
@@ -909,7 +909,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co
CMString displayName = dbv.ptszVal;
if (packname != NULL) {
char path[MAX_PATH];
- mir_snprintf(path, sizeof(path), "Smileys\\nova\\%s.msl", packname);
+ mir_snprintf(path, SIZEOF(path), "Smileys\\nova\\%s.msl", packname);
CMString paths = A2T_SM(path), patha;
pathToAbsolute(paths, patha);
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp
index 7f439020e0..b0331ee226 100644
--- a/plugins/StartupSilence/src/main.cpp
+++ b/plugins/StartupSilence/src/main.cpp
@@ -345,7 +345,7 @@ void RemoveTTButtons()
HANDLE GetIconHandle(char *szIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", MENU_NAME, szIcon);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MENU_NAME, szIcon);
return Skin_GetIconHandle(szSettingName);
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
index 33b130e1e7..5e08e14a20 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
@@ -141,13 +141,13 @@ void LoadOptions(TAAAProtoSettingList &loadSettings, BOOL override)
int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName)
{
char setting[128];
- mir_snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_OptionFlags", protoName);
autoAwaySetting.optionFlags = db_get_w(NULL, MODULENAME, setting, FLAG_LV2ONINACTIVE | FLAG_RESET);
- mir_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
autoAwaySetting.awayTime = db_get_w(NULL, MODULENAME, setting, SETTING_AWAYTIME_DEFAULT);
- mir_snprintf(setting, sizeof(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
autoAwaySetting.naTime = db_get_w(NULL, MODULENAME, setting, SETTING_NATIME_DEFAULT);
- mir_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
autoAwaySetting.statusFlags = db_get_w(NULL, MODULENAME, setting, StatusModeToProtoFlag(ID_STATUS_ONLINE) | StatusModeToProtoFlag(ID_STATUS_FREECHAT));
int flags;
@@ -155,9 +155,9 @@ int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName)
flags = 0xFFFFFF;
else
flags = CallProtoService(protoName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0);
- mir_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY)) ? ID_STATUS_AWAY : ID_STATUS_OFFLINE);
- mir_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA)) ? ID_STATUS_NA : ID_STATUS_OFFLINE);
return 0;
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
index c4d58d1747..97c5bf9675 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
@@ -34,17 +34,17 @@ static BOOL bSettingSame = FALSE;
static int WriteAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName)
{
char setting[128];
- mir_snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_OptionFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.optionFlags);
- mir_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.awayTime);
- mir_snprintf(setting, sizeof(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.naTime);
- mir_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.statusFlags);
- mir_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv1Status);
- mir_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv2Status);
return 0;
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
index 163e48f237..f21f169ae5 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
@@ -215,7 +215,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH
EnterCriticalSection(&GenStatusCS);
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", cs->szName);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", cs->szName);
cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus;
if (!db_get_b(NULL, MODULENAME, dbSetting, 1))
cs->status = ID_STATUS_DISABLED;
@@ -526,7 +526,7 @@ static int ProcessProtoAck(WPARAM,LPARAM lParam)
return 0;
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", ack->szModule);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", ack->szModule);
if (!db_get_b(NULL, MODULENAME, dbSetting, 1))
return 0;
@@ -1060,7 +1060,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam)
return -1;
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", szProto);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", szProto);
if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled
return -1;
@@ -1087,7 +1087,7 @@ INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam)
char *szProto = (char *)lParam;
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", szProto);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", szProto);
if (!db_get_b(NULL, MODULENAME, dbSetting, 1))
return FALSE;
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp
index a4611dd7bf..eb02862138 100644
--- a/plugins/StatusPlugins/KeepStatus/options.cpp
+++ b/plugins/StatusPlugins/KeepStatus/options.cpp
@@ -71,7 +71,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L
ListView_InsertItem(hList,&lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE));
lvItem.iItem++;
}
@@ -152,7 +152,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L
ListView_GetItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", (char *)lvItem.lParam);
db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp
index 21f84acbc3..8661aa7d02 100644
--- a/plugins/StatusPlugins/StartupStatus/options.cpp
+++ b/plugins/StatusPlugins/StartupStatus/options.cpp
@@ -816,7 +816,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
char setting[128];
int i, oldCount = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0);
for (i=0; i < oldCount; i++) {
- mir_snprintf(setting, sizeof(setting), "%d_", i);
+ mir_snprintf(setting, SIZEOF(setting), "%d_", i);
ClearDatabase(setting);
}
for (i=0; i < arProfiles.getCount(); i++) {
@@ -832,7 +832,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
TSettingsList& ar = *po.ps;
for (int j=0; j < ar.getCount(); j++) {
if ( ar[j].szMsg != NULL ) {
- mir_snprintf(setting, sizeof(setting), "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
+ mir_snprintf(setting, SIZEOF(setting), "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
db_set_ts(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg);
}
db_set_w(NULL, MODULENAME, OptName(i, ar[j].szName), ar[j].status);
@@ -959,6 +959,6 @@ static int DeleteSetting(const char *szSetting,LPARAM lParam)
char* OptName(int i, const char* setting)
{
static char buf[100];
- mir_snprintf(buf, sizeof(buf), "%d_%s", i, setting);
+ mir_snprintf(buf, SIZEOF(buf), "%d_%s", i, setting);
return buf;
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index 33ffb03994..c8a909bacf 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -107,7 +107,7 @@ static int CreateMainMenuItems(WPARAM wParam, LPARAM lParam)
mi.ptszName = profilename;
mi.position = 2000100000 + mcount;
- mir_snprintf(servicename, sizeof(servicename), "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount);
+ mir_snprintf(servicename, SIZEOF(servicename), "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount);
switch(mcount) {
case 0:
hProfileServices[mcount] = CreateServiceFunction(servicename, profileService0);
@@ -161,7 +161,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
char setting[80];
- mir_snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_PROFILENAME);
+ mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, SETTING_PROFILENAME);
if ( db_get_ts(NULL, MODULENAME, setting, &dbv))
return -1;
@@ -190,7 +190,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
for ( int i=0; i < pceCount; i++ ) {
if ( (pce[i].profile == profile) && (!strcmp(pce[i].szProto, szProto))) {
- mir_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db
pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(_tcslen(dbv.ptszVal)+1));
if (pce[i].msg != NULL) {
@@ -214,7 +214,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
pce[pceCount].profile = profile;
pce[pceCount].szProto = _strdup(szProto);
pce[pceCount].msg = NULL;
- mir_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
pce[pceCount].msg = _tcsdup(dbv.ptszVal);
db_free(&dbv);
@@ -264,7 +264,7 @@ INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam)
profile = (profile >= 0)?profile:db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0);
char setting[64];
- mir_snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG);
+ mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG);
if (!db_get_b(NULL, MODULENAME, setting, 0))
CallService(MS_CS_SETSTATUSEX,(WPARAM)&profileSettings, 0);
else
@@ -339,7 +339,7 @@ static int RegisterHotKeys()
return -1;
char atomname[255];
- mir_snprintf(atomname, sizeof(atomname), "StatusProfile_%d", i);
+ mir_snprintf(atomname, SIZEOF(atomname), "StatusProfile_%d", i);
hkInfo[hkiCount].id = GlobalAddAtomA(atomname);
if (hkInfo[hkiCount].id == 0)
continue;
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
index 9065e97b43..95308ac959 100644
--- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
+++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
@@ -47,14 +47,14 @@ TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa)
// load status
char setting[80];
- mir_snprintf(setting, sizeof(setting), "%d_%s", profile, pa->szModuleName);
+ mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, pa->szModuleName);
int iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
status = iStatus;
// load last status
- mir_snprintf(setting, sizeof(setting), "%s%s", PREFIX_LAST, szName);
+ mir_snprintf(setting, SIZEOF(setting), "%s%s", PREFIX_LAST, szName);
iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
@@ -168,7 +168,7 @@ static void SetLastStatusMessages(TSettingsList &ps)
continue;
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
@@ -301,9 +301,9 @@ static int OnOkToExit(WPARAM, LPARAM)
continue;
char lastName[128], lastMsg[128];
- mir_snprintf(lastName, sizeof(lastName), "%s%s", PREFIX_LAST, pa->szModuleName);
+ mir_snprintf(lastName, SIZEOF(lastName), "%s%s", PREFIX_LAST, pa->szModuleName);
db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
- mir_snprintf(lastMsg, sizeof(lastMsg), "%s%s", PREFIX_LASTMSG, pa->szModuleName);
+ mir_snprintf(lastMsg, SIZEOF(lastMsg), "%s%s", PREFIX_LASTMSG, pa->szModuleName);
db_unset(NULL, MODULENAME, lastMsg);
if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG))
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp
index c88ba01b8c..70d702f215 100644
--- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp
+++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp
@@ -55,12 +55,12 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam)
ttb.pszService = MS_SS_LOADANDSETPROFILE;
for (int i=0; i < profileCount; i++) {
char setting[80];
- mir_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
+ mir_snprintf(setting, SIZEOF(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
if (!db_get_b(NULL, MODULENAME, setting, FALSE))
continue;
DBVARIANT dbv;
- mir_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_PROFILENAME);
+ mir_snprintf(setting, SIZEOF(setting), "%d_%s", i, SETTING_PROFILENAME);
if (db_get(NULL, MODULENAME, setting, &dbv))
continue;
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index fa7186ed31..d384f9721d 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -730,12 +730,12 @@ void TSAPI BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, B
void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd)
{
DBVARIANT dbv = { 0 };
- char SettingName[1024] = { '\0' };
+ char SettingName[1024];
char* token = NULL;
//modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden
- mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
+ mir_snprintf(SettingName, SIZEOF(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) {
token = strtok(dbv.pszVal, "_");
@@ -757,13 +757,13 @@ void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd)
void CB_WriteButtonSettings(MCONTACT hContact, CustomButtonData *cbd)
{
- char SettingName[1024] = { '\0' };
- char SettingParameter[1024] = { '\0' };
+ char SettingName[1024];
+ char SettingParameter[1024];
//modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden
- mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
- mir_snprintf(SettingParameter, sizeof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->dwPosition, cbd->bIMButton, cbd->bChatButton, cbd->bLSided, cbd->bRSided, cbd->bCanBeHidden);
+ mir_snprintf(SettingName, SIZEOF(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
+ mir_snprintf(SettingParameter, SIZEOF(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->dwPosition, cbd->bIMButton, cbd->bChatButton, cbd->bLSided, cbd->bRSided, cbd->bCanBeHidden);
if (!(cbd->opFlags & BBSF_NTBDESTRUCT))
db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter);
else
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 1103d33dd8..590589603b 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -405,7 +405,7 @@ void Chat_AddIcons(void)
HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY)
{
char szTemp[256];
- mir_snprintf(szTemp, sizeof(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp);
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 8136cc9e72..65eec8bc58 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -687,7 +687,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
else {
char szCName[CONTAINER_NAMELEN + 20];
- mir_snprintf(szCName, sizeof(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, SIZEOF(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) {
if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName))
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 752bee529d..ac82f2133d 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -1201,9 +1201,9 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
static void SetupLogFormatting(TWindowData *dat)
{
if (dat->hHistoryEvents)
- mir_snprintf(dat->szMicroLf, sizeof(dat->szMicroLf), "%s", "\\v\\cf%d \\ ~-+%d+-~\\v0 ");
+ mir_snprintf(dat->szMicroLf, SIZEOF(dat->szMicroLf), "%s", "\\v\\cf%d \\ ~-+%d+-~\\v0 ");
else
- mir_snprintf(dat->szMicroLf, sizeof(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
+ mir_snprintf(dat->szMicroLf, SIZEOF(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
}
static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 18f441a628..48a3ec64df 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -1017,8 +1017,9 @@ LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam,
void Utils::sanitizeFilename(wchar_t* tszFilename)
{
static wchar_t *forbiddenCharacters = L"%/\\':|\"<>?";
+ static size_t forbiddenCharactersLen = mir_wstrlen(forbiddenCharacters);
- for (int i=0; i < mir_wstrlen(forbiddenCharacters); i++) {
+ for (size_t i=0; i < forbiddenCharactersLen; i++) {
wchar_t* szFound = 0;
while ((szFound = wcschr(tszFilename, (int)forbiddenCharacters[i])) != NULL)
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index 5d34c90513..12201aea07 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -292,12 +292,12 @@ void CExImContactBase::toIni(FILE* file, int modCount)
if (_pszProto == NULL || !loaded) {
if (_pszProto){
if (_pszNick)
- mir_snprintf(name, sizeof(name),"%s (%s)", _pszNick, _pszProto);
+ mir_snprintf(name, SIZEOF(name),"%s (%s)", _pszNick, _pszProto);
else
- mir_snprintf(name, sizeof(name),"(UNKNOWN) (%s)", _pszProto);
+ mir_snprintf(name, SIZEOF(name),"(UNKNOWN) (%s)", _pszProto);
}
else
- mir_snprintf(name, sizeof(name),"(UNKNOWN)");
+ mir_snprintf(name, SIZEOF(name),"%s", "(UNKNOWN)");
}
else {
// Proto loadet - GetContactName(hContact,pszProto,0)
@@ -316,9 +316,9 @@ void CExImContactBase::toIni(FILE* file, int modCount)
}
LPSTR pszUID = uid2String(FALSE);
if (_pszUIDKey && pszUID)
- mir_snprintf(name, sizeof(name), "%s *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID);
+ mir_snprintf(name, SIZEOF(name), "%s *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID);
else
- mir_snprintf(name, sizeof(name), "%s (%s)", pszCI, _pszProto);
+ mir_snprintf(name, SIZEOF(name), "%s (%s)", pszCI, _pszProto);
mir_free(pszCI);
mir_free(pszUID);
diff --git a/plugins/Variables/src/dbhelpers.h b/plugins/Variables/src/dbhelpers.h
index a3526dd473..9cad9fdce1 100644
--- a/plugins/Variables/src/dbhelpers.h
+++ b/plugins/Variables/src/dbhelpers.h
@@ -26,7 +26,7 @@ static int __inline DBWriteIthSettingByte(DWORD i, MCONTACT hContact,const char
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_b(hContact, szModule, dbSetting, val);
}
@@ -34,7 +34,7 @@ static int __inline DBWriteIthSettingWord(DWORD i, MCONTACT hContact,const char
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_w(hContact, szModule, dbSetting, val);
}
@@ -42,7 +42,7 @@ static int __inline DBWriteIthSettingDword(DWORD i, MCONTACT hContact,const char
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_dw(hContact, szModule, dbSetting, val);
}
@@ -50,7 +50,7 @@ static int __inline DBWriteIthSettingString(DWORD i, MCONTACT hContact,const cha
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_s(hContact, szModule, dbSetting, val);
}
@@ -59,7 +59,7 @@ static int __inline DBGetIthSettingByte(DWORD i, MCONTACT hContact, const char *
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_b(hContact, szModule, dbSetting, errorValue);
}
@@ -68,7 +68,7 @@ static WORD __inline DBGetIthSettingWord(DWORD i, MCONTACT hContact, const char
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_w(hContact, szModule, dbSetting, errorValue);
}
@@ -77,7 +77,7 @@ static DWORD __inline DBGetIthSettingDword(DWORD i, MCONTACT hContact, const cha
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_dw(hContact, szModule, dbSetting, errorValue);
}
@@ -86,7 +86,7 @@ static int __inline DBGetIthSetting(DWORD i, MCONTACT hContact, const char *szMo
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get(hContact, szModule, dbSetting, dbv);
}
@@ -94,7 +94,7 @@ static int __inline DBDeleteIthSetting(DWORD i, MCONTACT hContact,const char *sz
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_unset(hContact, szModule, dbSetting);
}
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp
index 4e02324658..6504463eee 100644
--- a/plugins/Variables/src/parse_inet.cpp
+++ b/plugins/Variables/src/parse_inet.cpp
@@ -40,7 +40,7 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai)
char hex[8];
MoveMemory(res + cur + 3, res + cur + 1, strlen(res + cur + 1) + 1);
- mir_snprintf(hex, sizeof(hex), "%%%x", *(res + cur));
+ mir_snprintf(hex, SIZEOF(hex), "%%%x", *(res + cur));
strncpy(res + cur, hex, strlen(hex));
cur += strlen(hex);
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp
index 6c18a921d7..2f83a7343d 100644
--- a/plugins/XSoundNotify/src/xsn_main.cpp
+++ b/plugins/XSoundNotify/src/xsn_main.cpp
@@ -71,7 +71,7 @@ void InitSelfSounds()
for (int i = 0; i < protoCount; i++) {
for(int j = 0; j < SIZEOF(selfSounds); j++) {
char namebuf[128];
- mir_snprintf(namebuf, sizeof(namebuf), "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
+ mir_snprintf(namebuf, SIZEOF(namebuf), "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
TCHAR infobuf[256];
mir_sntprintf(infobuf, SIZEOF(infobuf), _T("%s [%s]"), TranslateT("Self status"), protos[i]->tszAccountName);
@@ -87,7 +87,7 @@ static int ProtoAck(WPARAM wParam, LPARAM lParam)
for(int i = 0; i < SIZEOF(selfSounds); i++) {
if(selfSounds[i].iStatus == ack->lParam) {
char buf[128];
- mir_snprintf(buf, sizeof(buf), "%s%s", ack->szModule, selfSounds[i].szName);
+ mir_snprintf(buf, SIZEOF(buf), "%s%s", ack->szModule, selfSounds[i].szName);
SkinPlaySound(buf);
break;
}
diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp
index b44cfc53f5..d0de915c21 100644
--- a/plugins/YahooGroups/src/services.cpp
+++ b/plugins/YahooGroups/src/services.cpp
@@ -53,7 +53,7 @@ void ReadAvailableGroups()
while (ok)
{
- mir_snprintf(tmp, sizeof(tmp), "%d", index);
+ mir_snprintf(tmp, SIZEOF(tmp), "%d", index);
GetStringFromDatabase(NULL, CLIST_GROUPS, tmp, NULL, group, sizeof(group));
if (strlen(group) > 0)
{
@@ -76,7 +76,7 @@ int GetNextGroupIndex()
while (!found)
{
- mir_snprintf(tmp, sizeof(tmp), "%d", index++);
+ mir_snprintf(tmp, SIZEOF(tmp), "%d", index++);
if (GetStringFromDatabase(NULL, CLIST_GROUPS, tmp, NULL, buffer, sizeof(buffer)))
{
@@ -91,12 +91,12 @@ void AddNewGroup(char *newGroup)
{
int index = GetNextGroupIndex();
- char tmp[128] = {0};
- char group[1024] = {0};
+ char tmp[128];
+ char group[1024];
*group = 1;
- mir_snprintf(group + 1, sizeof(group) - 1, "%s", newGroup);
+ mir_snprintf((group + 1), (SIZEOF(group) - 1), "%s", newGroup);
- mir_snprintf(tmp, sizeof(tmp), "%d", index);
+ mir_snprintf(tmp, SIZEOF(tmp), "%d", index);
const int MAX_SIZE = 1024;
wchar_t wide[MAX_SIZE] = {0};
*wide = 1;
@@ -129,7 +129,7 @@ void CreateGroup(char *group)
strncat(buffer, sub, sizeof(buffer));
}
else{
- mir_snprintf(buffer, sizeof(buffer), "%s", sub);
+ mir_snprintf(buffer, SIZEOF(buffer), "%s", sub);
}
if (!availableGroups.Contains(buffer))
@@ -149,7 +149,7 @@ void CreateGroup(char *group)
strncat(buffer, sub, sizeof(buffer));
}
else{
- mir_snprintf(buffer, sizeof(buffer), "%s", sub);
+ mir_snprintf(buffer, SIZEOF(buffer), "%s", sub);
}
if (!availableGroups.Contains(buffer))
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp
index fe2640ae0d..d076626c15 100644
--- a/plugins/helpers/gen_helpers.cpp
+++ b/plugins/helpers/gen_helpers.cpp
@@ -81,12 +81,12 @@ int AddDebugLogMessageA(const char* fmt, ...)
va_list va;
va_start(va,fmt);
- mir_vsnprintf(szText, sizeof(szText), fmt, va);
+ mir_vsnprintf(szText, SIZEOF(szText), fmt, va);
va_end(va);
#ifdef MODULENAME
- mir_snprintf(szFinal, sizeof(szFinal), "%s: %s", MODULENAME, szText);
+ mir_snprintf(szFinal, SIZEOF(szFinal), "%s: %s", MODULENAME, szText);
#else
- strncpy(szFinal, szText, sizeof(szFinal));
+ strncpy(szFinal, szText, SIZEOF(szFinal));
#endif
res = WriteToDebugLogA(szFinal);
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
);
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index b5488e7d2f..2e0b692cc4 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -330,7 +330,7 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
*pszColon++ = 0;
if (!mir_strcmp(line, "Language")) {
- mir_snprintf(szLanguage, sizeof(szLanguage), "%s", pszColon);
+ mir_snprintf(szLanguage, SIZEOF(szLanguage), "%s", pszColon);
lrtrim(szLanguage);
}
else if (!mir_strcmp(line, "Last-Modified-Using")) {
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 0313c030bb..be0f16ef9f 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -432,7 +432,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
XStatus = 0;
char buf[255];
- mir_snprintf(buf, sizeof(buf), "*XStatus%d", XStatus);
+ mir_snprintf(buf, SIZEOF(buf), "*XStatus%d", XStatus);
bool check = wildcmp(smep->svc, buf) != 0;
bool reset = wildcmp(smep->svc, "*XStatus0") != 0;
@@ -991,7 +991,7 @@ void RebuildMenuOrder(void)
}
char buf[ 256 ];
- mir_snprintf(buf, sizeof(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, SIZEOF(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index f3ac197a5c..93dd2c0b7e 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -1047,7 +1047,7 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*)
mir_sntprintf(sectionName, SIZEOF(sectionName), LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName));
char iconame[256];
- mir_snprintf(iconame, sizeof(iconame), "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr);
+ mir_snprintf(iconame, SIZEOF(iconame), "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr);
// remove '&'
if (descr) {
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index c424554842..f5ab36b727 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -90,7 +90,7 @@ static int SaveTree(HWND hwndDlg)
TIntMenuObject *pimo = g_menus[menupos];
char MenuNameItems[256];
- mir_snprintf(MenuNameItems, sizeof(MenuNameItems), "%s_Items", pimo->pszName);
+ mir_snprintf(MenuNameItems, SIZEOF(MenuNameItems), "%s_Items", pimo->pszName);
int runtimepos = 100;
while (tvi.hItem != NULL) {
@@ -233,7 +233,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread)
if (pimo->m_items.first == NULL)
return FALSE;
- mir_snprintf(MenuNameItems, sizeof(MenuNameItems), "%s_Items", pimo->pszName);
+ mir_snprintf(MenuNameItems, SIZEOF(MenuNameItems), "%s_Items", pimo->pszName);
int count = 0;
{
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index c4ab423208..378a8535dd 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -61,12 +61,12 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam)
if (!p->textService) {
char szServiceName[100];
- mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventText%d", p->module, p->eventType);
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s/GetEventText%d", p->module, p->eventType);
p->textService = mir_strdup(szServiceName);
}
if (!p->iconService) {
char szServiceName[100];
- mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType);
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType);
p->iconService = mir_strdup(szServiceName);
}
eventTypes.insert(p);
@@ -216,7 +216,7 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam)
icon = Skin_GetIconByHandle(et->eventIcon);
if (!icon) {
char szName[100];
- mir_snprintf(szName, sizeof(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType);
+ mir_snprintf(szName, SIZEOF(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType);
icon = Skin_GetIcon(szName);
}
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp
index c1bd9551d7..3fc3e26e72 100644
--- a/src/modules/metacontacts/meta_utils.cpp
+++ b/src/modules/metacontacts/meta_utils.cpp
@@ -491,8 +491,8 @@ int Meta_SetAllNicks()
static void SwapValues(MCONTACT hContact, LPCSTR szSetting, int n1, int n2)
{
char buf1[100], buf2[100];
- mir_snprintf(buf1, sizeof(buf1), "%s%d", szSetting, n1);
- mir_snprintf(buf2, sizeof(buf2), "%s%d", szSetting, n2);
+ mir_snprintf(buf1, SIZEOF(buf1), "%s%d", szSetting, n1);
+ mir_snprintf(buf2, SIZEOF(buf2), "%s%d", szSetting, n2);
DBVARIANT dbv1, dbv2;
int ok1 = !db_get(hContact, META_PROTO, buf1, &dbv1);
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp
index 6484c010cd..5f3c1280de 100644
--- a/src/modules/netlib/netlibautoproxy.cpp
+++ b/src/modules/netlib/netlibautoproxy.cpp
@@ -169,14 +169,14 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps)
if ((nlc->nloc.flags & (NLOCF_HTTP | NLOCF_HTTPGATEWAY) && nlc->nloc.flags & NLOCF_SSL) ||
nlc->nloc.wPort == 443 || forceHttps)
{
- mir_snprintf(szUrl, sizeof(szUrl), "https://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, SIZEOF(szUrl), "https://%s", nlc->nloc.szHost);
usingSsl = true;
}
else if (nlc->nloc.flags & (NLOCF_HTTPGATEWAY | NLOCF_HTTP) || nlc->usingHttpGateway)
- mir_snprintf(szUrl, sizeof(szUrl), "http://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, SIZEOF(szUrl), "http://%s", nlc->nloc.szHost);
else
{
- mir_snprintf(szUrl, sizeof(szUrl), "%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, SIZEOF(szUrl), "%s", nlc->nloc.szHost);
noHttp = true;
}
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp
index c494cc5ce4..41db59805a 100644
--- a/src/modules/netlib/netlibsock.cpp
+++ b/src/modules/netlib/netlibsock.cpp
@@ -218,7 +218,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr)
if (addr->si_family == AF_INET) {
char *szIp = inet_ntoa(addr->Ipv4.sin_addr);
if (addr->Ipv4.sin_port != 0) {
- mir_snprintf(saddr, sizeof(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port));
+ mir_snprintf(saddr, SIZEOF(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port));
return mir_strdup(saddr);
}
return mir_strdup(szIp);
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index b10278e1dd..1775bbd886 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -273,7 +273,7 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction
char szData1[1024];
szReq = mir_strdup(szResult);
- sz = mir_snprintf (szData1, sizeof(szData1),
+ sz = mir_snprintf (szData1, SIZEOF(szData1),
soap_action, szActionName, szDev, szReq, szActionName);
sz = mir_snprintf (szData, 4096,
@@ -286,7 +286,7 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction
{
char szData1[1024];
- sz = mir_snprintf (szData1, sizeof(szData1),
+ sz = mir_snprintf (szData1, SIZEOF(szData1),
soap_query, szActionName);
sz = mir_snprintf (szData, 4096,
@@ -551,7 +551,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl)
strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl)-1] = 0;
- mir_snprintf(szTemp, sizeof(szTemp), search_device, szDev);
+ mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
txtParseParam(szData, szTemp, "<controlURL>", "</controlURL>", szUrl, sizeUrl);
// URL combining per RFC 2396
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 30fd40f6da..8ea3b242fb 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -424,7 +424,7 @@ static INT_PTR stub45(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
{
char tmp[100];
- mir_snprintf(tmp, sizeof(tmp), "%s%s", szModule, szService);
+ mir_snprintf(tmp, SIZEOF(tmp), "%s%s", szModule, szService);
return CreateServiceFunctionObj(tmp, pFunc, param);
}
diff --git a/src/modules/utils/enterstring.cpp b/src/modules/utils/enterstring.cpp
index 1e09a2a125..66bdbbbf32 100644
--- a/src/modules/utils/enterstring.cpp
+++ b/src/modules/utils/enterstring.cpp
@@ -56,7 +56,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm)
{
for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "%s%d", pForm->szDataPrefix, i);
+ mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, i);
ptrT tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
@@ -82,7 +82,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm)
id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "%s%d", pForm->szDataPrefix, id);
+ mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, id);
db_set_ts(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}