aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/blob.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2022-04-15 08:46:54 -0700
committerMike Buland <eichlan@xagasoft.com>2022-04-15 08:46:54 -0700
commit6e3124d6aec9d4ad9fbe92beec82add5e1a811fe (patch)
tree80f7453fa7ff35cec10736bad7f5b304c5d4b929 /src/unstable/blob.cpp
parent1c4372bbff3e5978b19bd25cf1310078d0977d08 (diff)
downloadlibbu++-6e3124d6aec9d4ad9fbe92beec82add5e1a811fe.tar.gz
libbu++-6e3124d6aec9d4ad9fbe92beec82add5e1a811fe.tar.bz2
libbu++-6e3124d6aec9d4ad9fbe92beec82add5e1a811fe.tar.xz
libbu++-6e3124d6aec9d4ad9fbe92beec82add5e1a811fe.zip
Augments to Blob and BlobBuilder.
You can construct a BlobBuilder from a Blob now, and Blob has an extra null byte of padding just in case you use a Blob to store a string.
Diffstat (limited to '')
-rw-r--r--src/unstable/blob.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/unstable/blob.cpp b/src/unstable/blob.cpp
index 69ec28f..e72e265 100644
--- a/src/unstable/blob.cpp
+++ b/src/unstable/blob.cpp
@@ -31,9 +31,10 @@ Bu::Blob::Blob( const class BlobBuilder &rSrc ) :
31 iSize( 0 ) 31 iSize( 0 )
32{ 32{
33 iSize = rSrc.getSize(); 33 iSize = rSrc.getSize();
34 pData = new char[iSize]; 34 pData = new char[iSize+1];
35 35
36 rSrc.copyTo( pData, iSize ); 36 rSrc.copyTo( pData, iSize );
37 pData[iSize] = '\0';
37} 38}
38 39
39Bu::Blob::Blob( const char *pSrc ) : 40Bu::Blob::Blob( const char *pSrc ) :