diff options
author | George Hazan <george.hazan@gmail.com> | 2012-10-19 17:56:29 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-10-19 17:56:29 +0000 |
commit | 4ba7149826b0f006d698e1055cfaf19ecd422cf4 (patch) | |
tree | f27fdd2c27e95e229129925d3f3d136263710d88 /plugins/CrashDumper/src | |
parent | f961c0206df845da319ed140747b146e01df764a (diff) |
fix for the protocols list
git-svn-id: http://svn.miranda-ng.org/main/trunk@1986 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper/src')
-rw-r--r-- | plugins/CrashDumper/src/dumper.cpp | 90 |
1 files changed, 35 insertions, 55 deletions
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index b1539a3658..b82f10defb 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -326,67 +326,47 @@ static void GetProtocolStrings(bkstring& buffer) int i, j;
ProtoEnumAccounts(&accCount, &accList);
- if (accCount > 0)
- {
- for (i = 0; i < accCount; i++)
- {
- TCHAR* nm;
- crsi_a2t(nm, accList[i]->szModuleName);
- buffer.appendfmt(TEXT(" 1 - %s\r\n"), nm);
- }
- }
- else
- {
- int protoCount;
- PROTOCOLDESCRIPTOR **protoList;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&protoList);
-
- int protoCountMy = 0;
- char** protoListMy = (char**)alloca((protoCount + accCount) * sizeof(char*));
- for (i = 0; i < protoCount; i++)
- {
- if (protoList[i]->type != PROTOTYPE_PROTOCOL) continue;
- protoListMy[protoCountMy++] = protoList[i]->szName;
- }
+ int protoCount;
+ PROTOCOLDESCRIPTOR **protoList;
+ CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&protoList);
- for (j = 0; j < accCount; j++)
- {
- for (i = 0; i < protoCountMy; i++)
- {
- if (strcmp(protoListMy[i], accList[j]->szProtoName) == 0)
- break;
- }
- if (i == protoCountMy)
- protoListMy[protoCountMy++] = accList[j]->szProtoName;
- }
+ int protoCountMy = 0;
+ char** protoListMy = (char**)alloca((protoCount + accCount) * sizeof(char*));
- ProtoCount *protos = (ProtoCount*)alloca(sizeof(ProtoCount) * protoCountMy);
- memset(protos, 0, sizeof(ProtoCount) * protoCountMy);
+ for (i = 0; i < protoCount; i++) {
+ if (protoList[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+ protoListMy[protoCountMy++] = protoList[i]->szName;
+ }
- for (j = 0; j < accCount; j++)
- {
- for (i = 0; i < protoCountMy; i++)
- {
- if (strcmp(protoListMy[i], accList[j]->szProtoName) == 0)
- {
- protos[i].nloaded = accList[j]->bDynDisabled != 0;
- if (IsAccountEnabled(accList[j]))
- ++protos[i].countse;
- else
- ++protos[i].countsd;
- break;
- }
- }
- }
+ for (j = 0; j < accCount; j++) {
for (i = 0; i < protoCountMy; i++)
- {
- TCHAR* nm;
- crsi_a2t(nm, protoListMy[i]);
- buffer.appendfmt(TEXT("%-24s %d - Enabled %d - Disabled %sLoaded\r\n"), nm, protos[i].countse,
- protos[i].countsd, protos[i].nloaded ? _T("Not ") : _T(""));
- }
+ if ( !strcmp(protoListMy[i], accList[j]->szProtoName))
+ break;
+
+ if (i == protoCountMy)
+ protoListMy[protoCountMy++] = accList[j]->szProtoName;
}
+
+ ProtoCount *protos = (ProtoCount*)alloca(sizeof(ProtoCount) * protoCountMy);
+ memset(protos, 0, sizeof(ProtoCount) * protoCountMy);
+
+ for (j = 0; j < accCount; j++)
+ for (i = 0; i < protoCountMy; i++)
+ if ( !strcmp(protoListMy[i], accList[j]->szProtoName)) {
+ protos[i].nloaded = accList[j]->bDynDisabled != 0;
+ if ( IsAccountEnabled(accList[j]))
+ ++protos[i].countse;
+ else
+ ++protos[i].countsd;
+ break;
+ }
+
+ for (i = 0; i < protoCountMy; i++)
+ buffer.appendfmt(TEXT("%-24s %d - Enabled %d - Disabled %sLoaded\r\n"),
+ (TCHAR*)_A2T(protoListMy[i]), protos[i].countse,
+ protos[i].countsd, protos[i].nloaded ? _T("Not ") : _T(""));
}
|