aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2005-09-10 00:37:52 +0000
committernyamatongwe <devnull@localhost>2005-09-10 00:37:52 +0000
commitddef0dae3c7aea5c16b76025d81d0193d49c59f6 (patch)
treeb0d939ec39c33fbd5f89776ff88fcc380f106d8a /src
parent1bbc78dc793d08b13d89f04ee9e9e557f8148a51 (diff)
downloadscintilla-mirror-ddef0dae3c7aea5c16b76025d81d0193d49c59f6.tar.gz
Added assertions to trap bugs earlier.
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 8200d4a59..2e8349481 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -769,6 +769,7 @@ bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mas
const char *CellBuffer::DeleteChars(int position, int deleteLength) {
// InsertString and DeleteChars are the bottleneck though which all changes occur
+ PLATFORM_ASSERT(deleteLength > 0);
char *data = 0;
if (!readOnly) {
if (collectingUndo) {
@@ -875,6 +876,7 @@ void CellBuffer::BasicInsertString(int position, char *s, int insertLength) {
//Platform::DebugPrintf("Inserting at %d for %d\n", position, insertLength);
if (insertLength == 0)
return ;
+ PLATFORM_ASSERT(insertLength > 0);
RoomFor(insertLength);
GapTo(position);