diff --git a/CMakeLists.txt b/CMakeLists.txt index 93884bf..367c8c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}") set(META_APP_DESCRIPTION "C++ library to read/write passwords from/to encrypted files") set(META_VERSION_MAJOR 3) set(META_VERSION_MINOR 2) -set(META_VERSION_PATCH 0) +set(META_VERSION_PATCH 1) set(META_PUBLIC_SHARED_LIB_DEPENDS c++utilities) set(META_PUBLIC_STATIC_LIB_DEPENDS c++utilities_static) diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index 90ee01f..f127646 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -291,7 +291,11 @@ void PasswordFile::load() stringstream decryptedStream(stringstream::in | stringstream::out | stringstream::binary); decryptedStream.exceptions(ios_base::failbit | ios_base::badbit); try { +#ifdef _LIBCPP_VERSION + decryptedStream.write(decryptedData.data(), static_cast(remainingSize)); +#else decryptedStream.rdbuf()->pubsetbuf(decryptedData.data(), static_cast(remainingSize)); +#endif if (version >= 0x5u) { const auto extendedHeaderSize = m_freader.readUInt16BE(); m_encryptedExtendedHeader = m_freader.readString(extendedHeaderSize);