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-zlib.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-zlib.cpp')
| -rw-r--r-- | src/streams-zlib.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/streams-zlib.cpp b/src/streams-zlib.cpp index 5784a17cf..9e139e301 100644 --- a/src/streams-zlib.cpp +++ b/src/streams-zlib.cpp @@ -9,6 +9,7 @@ * Released under GNU LGPL, read the file 'COPYING.LIB' for more information */ +#include <vector> #include "streams-zlib.h" namespace Inkscape { @@ -104,18 +105,17 @@ int ZlibBuffer::do_consume(guint8 *buf, int nbytes) int ZlibBuffer::do_consume_and_inflate(int nbytes) { - guint8 *buf=new guint8[nbytes]; + std::vector<guint8> buf(nbytes); - int ret=consume(buf, nbytes); + int ret=consume(&buf[0], nbytes); if ( ret != EOF ) { ret = 1; - GByteArray *gba = inflate(buf, nbytes); + GByteArray *gba = inflate(&buf[0], nbytes); copy_to_get(gba->data, gba->len); g_byte_array_free(gba, TRUE); } - delete [] buf; return ret; } |
