diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index da03ae3..2486872 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -349,10 +349,10 @@ 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 +#if defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION) decryptedStream.rdbuf()->pubsetbuf(decryptedData.data(), static_cast(remainingSize)); +#else + decryptedStream.write(decryptedData.data(), static_cast(remainingSize)); #endif if (m_version >= 0x5u) { BinaryReader reader(&decryptedStream);