Chromium Code Reviews| Index: core/fxcrt/fx_basic_wstring.cpp |
| diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp |
| index 95b761bd09e67a55b38ae5216ab5e555b8872a96..93570af04328fdb1639bf84bb32b36afe282b5ba 100644 |
| --- a/core/fxcrt/fx_basic_wstring.cpp |
| +++ b/core/fxcrt/fx_basic_wstring.cpp |
| @@ -642,7 +642,8 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld, |
| FX_WCHAR* lpszEnd = m_pData->m_String + m_pData->m_nDataLength; |
| FX_WCHAR* lpszTarget; |
| { |
|
Tom Sepez
2016/03/16 18:34:59
nit: brace needed here?
Wei Li
2016/03/17 02:24:05
Done.
|
| - while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) && |
| + while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) != |
| + nullptr && |
| lpszStart < lpszEnd) { |
|
Tom Sepez
2016/03/16 18:34:59
This should be fine. Not sure we want to write it
Wei Li
2016/03/17 02:24:05
For pdfium code, this warning is not that useful.
|
| nCount++; |
| lpszStart = lpszTarget + nSourceLen; |
| @@ -668,7 +669,7 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld, |
| lpszEnd = m_pData->m_String + std::max(m_pData->m_nDataLength, nNewLength); |
| { |
| while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) != |
| - NULL && |
| + nullptr && |
| lpszStart < lpszEnd) { |
| FX_STRSIZE nBalance = |
| nOldLength - |