From 99095773aa31bf8eb283d6f6319a29c71e51ca9c Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 4 Aug 2023 13:23:44 -0700 Subject: Woo! Unit Tests! Found some bugs! --- src/stable/string.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/stable') diff --git a/src/stable/string.cpp b/src/stable/string.cpp index d8fd218..6bb2c8e 100644 --- a/src/stable/string.cpp +++ b/src/stable/string.cpp @@ -15,7 +15,7 @@ #include "bu/blob.h" #include -#define nMinSize (256) +#define nMinSize (255) Bu::StringCore::StringCore() : nLength( 0 ), @@ -83,7 +83,7 @@ Bu::StringCore::Chunk *Bu::StringCore::newChunk( long nLen ) const Chunk *pNew = new Chunk; pNew->pNext = NULL; pNew->nLength = nLen; - pNew->pData = new char[(nLenpData = new char[(nLenpData[nLen] = (char)0; return pNew; } @@ -95,7 +95,7 @@ Bu::StringCore::Chunk *Bu::StringCore::copyChunk( pNew->pNext = pSrc->pNext; pNew->nLength = pSrc->nLength; pNew->pData = new char[ - (pNew->nLengthnLength)+1 + (pNew->nLengthnLength)+1 ]; memcpy( pNew->pData, pSrc->pData, pSrc->nLength ); pNew->pData[pNew->nLength] = (char)0; -- cgit v1.2.3