aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-10-29 05:29:00 +0000
committerMike Buland <eichlan@xagasoft.com>2011-10-29 05:29:00 +0000
commit9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3 (patch)
treeb9df76895e5a773b0f92b09b1b37bdc852698c6b /src
parent9906ffe3c54875133448134c09ec12a0949d48cd (diff)
downloadlibbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.tar.gz
libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.tar.bz2
libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.tar.xz
libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.zip
zlib can't really handle empty buffers, so we don't pass empty buffers to it
now, even if the function parameters indicate that.
Diffstat (limited to '')
-rw-r--r--src/deflate.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/deflate.cpp b/src/deflate.cpp
index 2d925a7..704d172 100644
--- a/src/deflate.cpp
+++ b/src/deflate.cpp
@@ -123,6 +123,8 @@ void Bu::Deflate::zError( int code )
123Bu::size Bu::Deflate::read( void *pData, Bu::size nBytes ) 123Bu::size Bu::Deflate::read( void *pData, Bu::size nBytes )
124{ 124{
125 TRACE( pData, nBytes ); 125 TRACE( pData, nBytes );
126 if( nBytes <= 0 )
127 return 0;
126 if( !pState->state ) 128 if( !pState->state )
127 { 129 {
128 bReading = true; 130 bReading = true;
@@ -191,6 +193,8 @@ Bu::size Bu::Deflate::read( void *pData, Bu::size nBytes )
191Bu::size Bu::Deflate::write( const void *pData, Bu::size nBytes ) 193Bu::size Bu::Deflate::write( const void *pData, Bu::size nBytes )
192{ 194{
193 TRACE( pData, nBytes ); 195 TRACE( pData, nBytes );
196 if( nBytes <= 0 )
197 return 0;
194 if( !pState->state ) 198 if( !pState->state )
195 { 199 {
196 bReading = false; 200 bReading = false;