summaryrefslogtreecommitdiff
path: root/src/modules/skin/skinicons.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-23 17:52:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-23 17:52:28 +0000
commit42563b1b6cf473a4ba10a327ac79adfc66ec71ba (patch)
tree657cc2f57157230c144e36312d685a0a113447b8 /src/modules/skin/skinicons.cpp
parentc3850aba6397cc8f0e25dabde4968a252c205343 (diff)
bugfix: LoadSkinProtoIcon returns global icons when a protocol is not fully created
git-svn-id: http://svn.miranda-ng.org/main/trunk@3737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/skin/skinicons.cpp')
-rw-r--r--src/modules/skin/skinicons.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp
index b5f876e4cd..b9400eeedf 100644
--- a/src/modules/skin/skinicons.cpp
+++ b/src/modules/skin/skinicons.cpp
@@ -216,15 +216,19 @@ void Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId)
//
HICON LoadSkinProtoIcon(const char* szProto, int status, bool big)
{
- int statusIndx = -1;
char iconName[MAX_PATH];
- DWORD caps2 = (szProto == NULL) ? (DWORD)-1 : CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_2, 0);
+ INT_PTR caps2;
+ if (szProto == NULL)
+ caps2 = -1;
+ else if ((caps2 = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_2, 0)) == CALLSERVICE_NOTFOUND)
+ caps2 = 0;
if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, 7);
return IcoLib_GetIcon(iconName, big);
}
+ int statusIndx = -1;
for (int i=0; i < SIZEOF(statusIcons); i++) {
if (statusIcons[i].id == status) {
statusIndx = i;