summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-09-19 12:09:00 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-09-19 12:09:00 +0000
commitfc44d63282dd3639045cc6ef81cf49d8b14d167f (patch)
treeae4d4fc875e1145308222fec6cd5741209e4b8c6 /plugins
parentfd7a3ebacbdac24fd557b20f10282556bfd77bc9 (diff)
TranslitSwitcher: crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@15395 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TranslitSwitcher/src/Layoutproc.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp
index 28e99f75e5..9354fe6aec 100644
--- a/plugins/TranslitSwitcher/src/Layoutproc.cpp
+++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp
@@ -706,17 +706,17 @@ int OnButtonPressed(WPARAM, LPARAM lParam)
}
ptrT tszSymbol(db_get_tsa(NULL, "TranslitSwitcher", "ResendSymbol"));
- if (tszSymbol == NULL) {
+ if (!tszSymbol && sel) {
SetWindowText(hEdit, sel);
SendMessage(hEdit, EM_SETSEL, 0, (LPARAM)slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
- else if (_tcsncmp(sel, tszSymbol, mir_tstrlen(tszSymbol)) == 0) {
+ else if (sel && !mir_tstrncmp(sel, tszSymbol, mir_tstrlen(tszSymbol))) {
SetWindowText(hEdit, sel);
SendMessage(hEdit, EM_SETSEL, 0, (LPARAM)slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
- else {
+ else if (sel) {
CMString tszFinal(FORMAT, _T("%s %s"), tszSymbol, sel);
SetWindowText(hEdit, tszFinal.GetString());
SendMessage(hEdit, EM_SETSEL, 0, tszFinal.GetLength());