From ed7fc665efb63c38d6bde87d416f1e029e75d4ce Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 10 Sep 2005 00:37:52 +0000 Subject: Added assertions to trap bugs earlier. --- src/CellBuffer.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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); -- cgit v1.2.3