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/KeyboardNotify/src/main.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'plugins/KeyboardNotify/src/main.cpp') diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index b44e1de20d..6de02d77ee 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -783,15 +783,11 @@ void GetWindowsVersion(void) void updateXstatusProto(PROTOCOL_INFO *protoInfo) { - unsigned int i; - char szServiceName[MAXMODULELABELLENGTH]; - CUSTOM_STATUS xstatus={0}; - - mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_GETCUSTOMSTATUSEX); - if (!ServiceExists(szServiceName)) return; + if (!ProtoServiceExists(protoInfo->szProto, PS_GETCUSTOMSTATUSEX)) + return; // Retrieve xstatus.count - xstatus.cbSize = sizeof(CUSTOM_STATUS); + CUSTOM_STATUS xstatus = { sizeof(xstatus) }; xstatus.flags = CSSF_STATUSES_COUNT; xstatus.wParam = &(protoInfo->xstatus.count); CallProtoService(protoInfo->szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); @@ -802,9 +798,8 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo) if (!protoInfo->xstatus.enabled) protoInfo->xstatus.count = 0; else - for(i=0; i < protoInfo->xstatus.count; i++) + for(unsigned i=0; i < protoInfo->xstatus.count; i++) protoInfo->xstatus.enabled[i] = FALSE; - } -- cgit v1.2.3