diff options
Diffstat (limited to 'src/stable')
-rw-r--r-- | src/stable/string.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ | |||
15 | #include "bu/blob.h" | 15 | #include "bu/blob.h" |
16 | #include <stdlib.h> | 16 | #include <stdlib.h> |
17 | 17 | ||
18 | #define nMinSize (256) | 18 | #define nMinSize (255) |
19 | 19 | ||
20 | Bu::StringCore::StringCore() : | 20 | Bu::StringCore::StringCore() : |
21 | nLength( 0 ), | 21 | nLength( 0 ), |
@@ -83,7 +83,7 @@ Bu::StringCore::Chunk *Bu::StringCore::newChunk( long nLen ) const | |||
83 | Chunk *pNew = new Chunk; | 83 | Chunk *pNew = new Chunk; |
84 | pNew->pNext = NULL; | 84 | pNew->pNext = NULL; |
85 | pNew->nLength = nLen; | 85 | pNew->nLength = nLen; |
86 | pNew->pData = new char[(nLen<nMinSize)?(nMinSize):(nLen)+1]; | 86 | pNew->pData = new char[(nLen<nMinSize)?(nMinSize+1):(nLen)+1]; |
87 | pNew->pData[nLen] = (char)0; | 87 | pNew->pData[nLen] = (char)0; |
88 | return pNew; | 88 | return pNew; |
89 | } | 89 | } |
@@ -95,7 +95,7 @@ Bu::StringCore::Chunk *Bu::StringCore::copyChunk( | |||
95 | pNew->pNext = pSrc->pNext; | 95 | pNew->pNext = pSrc->pNext; |
96 | pNew->nLength = pSrc->nLength; | 96 | pNew->nLength = pSrc->nLength; |
97 | pNew->pData = new char[ | 97 | pNew->pData = new char[ |
98 | (pNew->nLength<nMinSize)?(nMinSize):(pNew->nLength)+1 | 98 | (pNew->nLength<nMinSize)?(nMinSize+1):(pNew->nLength)+1 |
99 | ]; | 99 | ]; |
100 | memcpy( pNew->pData, pSrc->pData, pSrc->nLength ); | 100 | memcpy( pNew->pData, pSrc->pData, pSrc->nLength ); |
101 | pNew->pData[pNew->nLength] = (char)0; | 101 | pNew->pData[pNew->nLength] = (char)0; |