From 53669871fc860856c80c2d79cb6b21d52ea25440 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Sep 2023 12:56:54 +0300 Subject: unneeded conversions removed --- plugins/SmileyAdd/src/services.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'plugins/SmileyAdd/src/services.cpp') diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 73fcb7e450..eb9210e2eb 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -58,9 +58,9 @@ SmileyPackType* FindSmileyPack(const char *proto, MCONTACT hContact, SmileyPackC auto *p = g_SmileyCategories.GetSmileyCategory(categoryName); if (!p || p->GetFilename().IsEmpty()) - categoryName = _A2T(protonam); + categoryName = protonam; } - else categoryName = _A2T(protonam); + else categoryName = protonam; } } } @@ -69,7 +69,7 @@ SmileyPackType* FindSmileyPack(const char *proto, MCONTACT hContact, SmileyPackC if (proto == nullptr || proto[0] == 0) categoryName = L"Standard"; else { - categoryName = _A2T(proto); + categoryName = proto; if (opt.UseOneForAll) { SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(categoryName); if (smc == nullptr || smc->IsProto()) @@ -206,15 +206,13 @@ INT_PTR FreeTextBatch(WPARAM, LPARAM lParam) INT_PTR RegisterPack(WPARAM, LPARAM lParam) { SMADD_REGCAT *smre = (SMADD_REGCAT*)lParam; + if (smre == nullptr || smre->cbSize < sizeof(SMADD_REGCAT)) + return FALSE; - if (smre == nullptr || smre->cbSize < sizeof(SMADD_REGCAT)) return FALSE; - if (IsBadStringPtrA(smre->name, 50) || IsBadStringPtrA(smre->dispname, 50)) return FALSE; - - - CMStringW nmd(_A2T(smre->dispname)); - CMStringW nm(_A2T(smre->name)); - g_SmileyCategories.AddAndLoad(nm, nmd); + if (IsBadStringPtrA(smre->name, 50) || IsBadStringPtrA(smre->dispname, 50)) + return FALSE; + g_SmileyCategories.AddAndLoad(_A2T(smre->name), _A2T(smre->dispname)); return TRUE; } @@ -386,7 +384,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) case PRAC_CHANGED: if (acc != nullptr && acc->szModuleName != nullptr) { - CMStringW name(_A2T(acc->szModuleName)); + CMStringW name(acc->szModuleName); SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(name); if (smc != nullptr) { if (acc->tszAccountName) -- cgit v1.2.3