From fc44d63282dd3639045cc6ef81cf49d8b14d167f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 19 Sep 2015 12:09:00 +0000 Subject: TranslitSwitcher: crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@15395 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TranslitSwitcher/src/Layoutproc.cpp | 6 +++--- 1 file 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()); -- cgit v1.2.3