summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_binarybuf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_binarybuf.cpp')
-rw-r--r--core/fxcrt/cfx_binarybuf.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fxcrt/cfx_binarybuf.cpp b/core/fxcrt/cfx_binarybuf.cpp
index 6c67912d3b..73fe945fd6 100644
--- a/core/fxcrt/cfx_binarybuf.cpp
+++ b/core/fxcrt/cfx_binarybuf.cpp
@@ -20,10 +20,9 @@ CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size)
CFX_BinaryBuf::~CFX_BinaryBuf() {}
void CFX_BinaryBuf::Delete(FX_STRSIZE start_index, FX_STRSIZE count) {
- if (!m_pBuffer || start_index < 0 || count < 0 || count > m_DataSize ||
- start_index > m_DataSize - count) {
+ if (!m_pBuffer || count > m_DataSize || start_index > m_DataSize - count)
return;
- }
+
memmove(m_pBuffer.get() + start_index, m_pBuffer.get() + start_index + count,
m_DataSize - start_index - count);
m_DataSize -= count;