summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-25 12:56:54 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-25 12:56:54 +0300
commit53669871fc860856c80c2d79cb6b21d52ea25440 (patch)
tree2c47183a97b24fa22c351de63e3388b5a96ed3b5 /plugins/SmileyAdd/src/services.cpp
parentb6d8bea965ba61b5ee8328144bd62caed1d5f563 (diff)
unneeded conversions removed
Diffstat (limited to 'plugins/SmileyAdd/src/services.cpp')
-rw-r--r--plugins/SmileyAdd/src/services.cpp20
1 files changed, 9 insertions, 11 deletions
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)