diff options
| author | MenTaLguY <mental@rydia.net> | 2006-05-09 03:00:35 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2006-05-09 03:00:35 +0000 |
| commit | a7521789b390bf001092f104cd7e77df5470cfa1 (patch) | |
| tree | 79ccbfc52d1c367982cd6997fb9faae8761a228e /src/streams-jar.cpp | |
| parent | use array new rather than dynamically-sized automatic arrays, plus cleanups a... (diff) | |
| download | inkscape-a7521789b390bf001092f104cd7e77df5470cfa1.tar.gz inkscape-a7521789b390bf001092f104cd7e77df5470cfa1.zip | |
hmm, make that std::vector
(bzr r783)
Diffstat (limited to 'src/streams-jar.cpp')
| -rw-r--r-- | src/streams-jar.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/streams-jar.cpp b/src/streams-jar.cpp index 521b1f9a9..e597822e9 100644 --- a/src/streams-jar.cpp +++ b/src/streams-jar.cpp @@ -1,3 +1,4 @@ +#include <vector> #include "streams-jar.h" namespace Inkscape { @@ -81,9 +82,8 @@ int JarBuffer::consume_compressed(int nbytes) int ret=do_consume_and_inflate(nbytes); if ( ret == EOF && eflen > 0 ) { - guint8 *efbuf=new guint8[eflen]; - _urihandle->read(efbuf, eflen); - delete [] efbuf; + std::vector<guint8> efbuf(eflen); + _urihandle->read(&efbuf[0], eflen); return 1; } @@ -92,13 +92,12 @@ int JarBuffer::consume_compressed(int nbytes) int JarBuffer::consume_uncompressed(int nbytes) { - guint8 *data=new guint8[nbytes]; - int consumed=consume(data, nbytes); + std::vector<guint8> data(nbytes); + int consumed=consume(&data[0], nbytes); if ( consumed != EOF ) { - copy_to_get(data, consumed); + copy_to_get(&data[0], consumed); compressed_left -= consumed; } - delete [] data; return consumed; } |
