From 81337e86426dd4a79836554342bdc2e7e6195769 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Jun 2013 14:12:13 +0000 Subject: massive extinction of stupid service name's buffers git-svn-id: http://svn.miranda-ng.org/main/trunk@5010 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clistmod.cpp | 6 ++---- plugins/Clist_modern/src/modern_statusbar.cpp | 10 +++------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'plugins/Clist_modern') diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index db2b694093..87fa738081 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -93,7 +93,6 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) { if (hContact && szProto) { char *szActProto = (char*)szProto; - char AdvancedService[255] = {0}; int nActStatus = nStatus; HANDLE hActContact = hContact; if ( !db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName)) { @@ -108,11 +107,10 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) } } } - mir_snprintf(AdvancedService,SIZEOF(AdvancedService),"%s%s",szActProto,"/GetAdvancedStatusIcon"); int result = -1; - if ( ServiceExists(AdvancedService)) - result = CallService(AdvancedService,(WPARAM)hActContact, 0); + if ( ProtoServiceExists(szActProto, PS_GETADVANCEDSTATUSICON)) + result = CallProtoService(szActProto, PS_GETADVANCEDSTATUSICON, (WPARAM)hActContact, 0); if (result == -1 || !(LOWORD(result))) { //Get normal Icon diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index a8eef4b790..b18c3c5008 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -381,10 +381,8 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if ((p.xStatusMode & 3)) { if (p.ProtoStatus > ID_STATUS_OFFLINE) { - char str[MAXMODULELABELLENGTH]; - mir_snprintf(str, SIZEOF(str), "%s%s", p.AccountName, PS_GETCUSTOMSTATUSICON); - if ( ServiceExists(str)) - p.extraIcon = (HICON)CallService(str, 0, 0); + if ( ProtoServiceExists(p.AccountName, PS_GETCUSTOMSTATUSICON)) + p.extraIcon = (HICON)CallProtoService(p.AccountName, PS_GETCUSTOMSTATUSICON, 0, 0); if (p.extraIcon && (p.xStatusMode & 3) == 3) w += GetSystemMetrics(SM_CXSMICON)+1; } @@ -467,9 +465,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (p.showProtoIcon) { if (p.ProtoStatus > ID_STATUS_OFFLINE && (p.xStatusMode & 3) > 0) { - char str[MAXMODULELABELLENGTH]; - mir_snprintf(str, SIZEOF(str), "%s%s", p.AccountName, PS_GETCUSTOMSTATUSICON); - if ( ServiceExists(str)) { + if ( ProtoServiceExists(p.AccountName, PS_GETCUSTOMSTATUSICON)) { hxIcon = p.extraIcon; if (hxIcon) { if ((p.xStatusMode & 3) == 2) { -- cgit v1.2.3