diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-22 19:57:38 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-22 19:57:38 +0300 |
commit | 5f68e67d61e0c0ffa6aacd80eda9e0e5c531cc7a (patch) | |
tree | b586b6b439db76cc1113846205b6f068e2de3e81 | |
parent | 09d4bcc35300cc75de83e27041afa8067f1d4bd6 (diff) |
even more accurate form of check
-rw-r--r-- | src/mir_app/src/srmm_log_rtf.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mir_app/src/srmm_log_rtf.cpp b/src/mir_app/src/srmm_log_rtf.cpp index e3b016de14..a639264ab7 100644 --- a/src/mir_app/src/srmm_log_rtf.cpp +++ b/src/mir_app/src/srmm_log_rtf.cpp @@ -525,9 +525,12 @@ INT_PTR CRtfLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam) if (wchar_t *p = wcschr(pszWord, '\r'))
*p = 0;
- size_t iLen = mir_wstrlen(pszWord) - 1;
- for (; iLen && wcschr(szTrimString, pszWord[iLen]); iLen--)
- pszWord[iLen] = '\0';
+ int iLen = (int)mir_wstrlen(pszWord) - 1;
+ while (iLen >= 0) {
+ if (!wcschr(szTrimString, pszWord[iLen]))
+ break;
+ pszWord[iLen--] = '\0';
+ }
if (iLen) {
CMStringW wszText(FORMAT, TranslateT("Look up '%s"), pszWord);
|