diff options
Diffstat (limited to 'plugins/AssocMgr/src')
-rw-r--r-- | plugins/AssocMgr/src/assoclist.cpp | 16 | ||||
-rw-r--r-- | plugins/AssocMgr/src/test.cpp | 22 |
2 files changed, 19 insertions, 19 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;
|