diff options
Diffstat (limited to 'src/mir_app')
-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);
|