diff options
Diffstat (limited to 'plugins')
71 files changed, 353 insertions, 348 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);
|