diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-05 15:33:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-06 13:53:19 +0000 |
commit | 81f9eeef041f2974274751d7508598049ae32db2 (patch) | |
tree | 00bdcdddc9d141e4929005a14372bde65c68ee81 /core/fxcrt/cfx_widestring.h | |
parent | 3ef61c73a97b31000a21e323e04ad5397e517c4c (diff) | |
download | pdfium-81f9eeef041f2974274751d7508598049ae32db2.tar.xz |
Convert FX_STRSIZE int->size_t
Change the underlying type for FX_STRSIZE to size_t from int. This
will make the value unsigned and thus all values in the range of the
type will be valid. This allows for the final remove of negative
length strings, but also introduces a some casting and functional
errors, since many parts of the code base assume that FX_STRSIZE is
int or another signed type. This also CL fixes these errors.
BUG=pdfium:828
Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b
Reviewed-on: https://pdfium-review.googlesource.com/11830
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_widestring.h')
-rw-r--r-- | core/fxcrt/cfx_widestring.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/core/fxcrt/cfx_widestring.h b/core/fxcrt/cfx_widestring.h index 100fec6706..9922e4277a 100644 --- a/core/fxcrt/cfx_widestring.h +++ b/core/fxcrt/cfx_widestring.h @@ -80,14 +80,8 @@ class CFX_WideString { return m_pData ? FXSYS_wcslen(m_pData->m_String) : 0; } bool IsEmpty() const { return !GetLength(); } - - bool IsValidIndex(FX_STRSIZE index) const { - return 0 <= index && index < GetLength(); - } - - bool IsValidLength(FX_STRSIZE length) const { - return 0 <= length && length <= GetLength(); - } + bool IsValidIndex(FX_STRSIZE index) const { return index < GetLength(); } + bool IsValidLength(FX_STRSIZE length) const { return length <= GetLength(); } const CFX_WideString& operator=(const wchar_t* str); const CFX_WideString& operator=(const CFX_WideString& stringSrc); |