diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-04-09 19:19:30 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-04-09 19:19:30 +0000 |
| commit | 352a8b65716e482c44920cc94d5f48ca5bc49068 (patch) | |
| tree | ffe4dc958784862f78673d19af0d10c5aa2fa8c0 /src/io/gzipstream.cpp | |
| parent | Documentation / dropping some pointer conversions in context menu (diff) | |
| download | inkscape-352a8b65716e482c44920cc94d5f48ca5bc49068.tar.gz inkscape-352a8b65716e482c44920cc94d5f48ca5bc49068.zip | |
cppcheck stuff
(bzr r11201)
Diffstat (limited to 'src/io/gzipstream.cpp')
| -rw-r--r-- | src/io/gzipstream.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp index ed94974fe..efa96412d 100644 --- a/src/io/gzipstream.cpp +++ b/src/io/gzipstream.cpp @@ -37,6 +37,7 @@ GzipInputStream::GzipInputStream(InputStream &sourceStream) loaded(false), totalIn(0), totalOut(0), + srcBuf(NULL), outputBuf(NULL), crc(0), srcCrc(0), @@ -57,11 +58,11 @@ GzipInputStream::~GzipInputStream() close(); if ( srcBuf ) { free(srcBuf); - srcBuf = 0; + srcBuf = NULL; } if ( outputBuf ) { free(outputBuf); - outputBuf = 0; + outputBuf = NULL; } } @@ -94,11 +95,11 @@ void GzipInputStream::close() if ( srcBuf ) { free(srcBuf); - srcBuf = 0; + srcBuf = NULL; } if ( outputBuf ) { free(outputBuf); - outputBuf = 0; + outputBuf = NULL; } closed = true; } @@ -117,10 +118,9 @@ int GzipInputStream::get() } else { loaded = true; - int zerr = Z_OK; if ( outputBufPos >= outputBufLen ) { // time to read more, if we can - zerr = fetchMore(); + fetchMore(); } if ( outputBufPos < outputBufLen ) { @@ -201,13 +201,13 @@ bool GzipInputStream::load() //OS val = (int)srcBuf[9]; - int cur = 10; // if ( flags & FEXTRA ) { // headerLen += 2; // int xlen = // TODO deal with optional header parts // } if ( flags & FNAME ) { + int cur = 10; while ( srcBuf[cur] ) { cur++; @@ -229,10 +229,6 @@ bool GzipInputStream::load() | ((0x0ff & srcBuf[srcLen - 4]) << 0); //printf("srcSiz:%lx/%ld\n", srcSiz, srcSiz); - if ( srcSiz <= 0 ) { - return false; - } - //outputBufLen = srcSiz + srcSiz/100 + 14; unsigned char *data = srcBuf + headerLen; |
