summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_basic_bstring.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-13 14:27:11 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-13 14:27:11 -0700
commite83c77e9a68f2e0ac7632ac40f5b09a0e888093a (patch)
treeb2c55bd062db704c7a758aee9afb4a788200fe2f /core/src/fxcrt/fx_basic_bstring.cpp
parentcf22eb8ac24d944aac08d6a17c12b8a3a602c6f5 (diff)
downloadpdfium-e83c77e9a68f2e0ac7632ac40f5b09a0e888093a.tar.xz
Merge to XFA: Fix comparison of CFX_ByteString and CFX_WideString.
Original Review URL: https://codereview.chromium.org/1141763002 BUG=pdfium:160 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1140093003
Diffstat (limited to 'core/src/fxcrt/fx_basic_bstring.cpp')
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 31621490d7..65f4b36b90 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -254,10 +254,10 @@ const CFX_ByteString& CFX_ByteString::operator+=(FX_BSTR string)
bool CFX_ByteString::Equal(const char* ptr) const
{
if (!m_pData) {
- return !ptr;
+ return !ptr || ptr[0] == '\0';
}
if (!ptr) {
- return false;
+ return m_pData->m_nDataLength == 0;
}
return strlen(ptr) == m_pData->m_nDataLength &&
FXSYS_memcmp32(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0;
@@ -272,10 +272,10 @@ bool CFX_ByteString::Equal(const CFX_ByteStringC& str) const
}
bool CFX_ByteString::Equal(const CFX_ByteString& other) const
{
- if (!m_pData) {
+ if (IsEmpty()) {
return other.IsEmpty();
}
- if (!other.m_pData) {
+ if (other.IsEmpty()) {
return false;
}
return other.m_pData->m_nDataLength == m_pData->m_nDataLength &&