diff options
-rw-r--r-- | src/lib/libvisio_utils.cpp | 7 | ||||
-rw-r--r-- | src/lib/libvisio_utils.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libvisio_utils.cpp b/src/lib/libvisio_utils.cpp index 42e2adc..88bd2b8 100644 --- a/src/lib/libvisio_utils.cpp +++ b/src/lib/libvisio_utils.cpp @@ -123,14 +123,15 @@ double libvisio::readDouble(WPXInputStream *input) return tmpUnion.d; } -void libvisio::appendFromBase64(WPXBinaryData &data, const unsigned char *base64String, size_t base64StringLength) +void libvisio::appendFromBase64(WPXBinaryData &data, const unsigned char *base64Data, size_t base64DataLength) { + std::string base64String((const char*)base64Data, base64DataLength); typedef boost::archive::iterators::transform_width< boost::archive::iterators::binary_from_base64< - boost::archive::iterators::remove_whitespace< const char * > >, 8, 6 > base64_decoder; + boost::archive::iterators::remove_whitespace< std::string::const_iterator > >, 8, 6 > base64_decoder; std::vector<unsigned char> buffer; - std::copy(base64_decoder(base64String), base64_decoder(base64String + base64StringLength), std::back_inserter(buffer)); + std::copy(base64_decoder(base64String.begin()), base64_decoder(base64String.end()), std::back_inserter(buffer)); if (!buffer.empty()) data.append(&buffer[0], buffer.size()); diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h index 2298907..3cd6afa 100644 --- a/src/lib/libvisio_utils.h +++ b/src/lib/libvisio_utils.h @@ -98,7 +98,7 @@ uint64_t readU64(WPXInputStream *input); double readDouble(WPXInputStream *input); -void appendFromBase64(WPXBinaryData &data, const unsigned char *base64String, size_t base64StringLength); +void appendFromBase64(WPXBinaryData &data, const unsigned char *base64Data, size_t base64DataLength); const ::WPXString getColourString(const Colour &c); |