diff --git a/CMakeLists.txt b/CMakeLists.txt index 736ec68..4b7f60c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,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 5) set(META_VERSION_MINOR 0) -set(META_VERSION_PATCH 1) +set(META_VERSION_PATCH 2) set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON) # add project files diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index 91767ca..a63bf25 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -507,6 +507,7 @@ void PasswordFile::write(PasswordFileSaveFlags options) if (!(options & PasswordFileSaveFlags::Encryption)) { // write data to file m_file.write(decryptedData.data(), static_cast(size)); + m_file.flush(); return; } @@ -560,6 +561,7 @@ void PasswordFile::write(PasswordFileSaveFlags options) } m_file.write(reinterpret_cast(iv), aes256cbcIvSize); m_file.write(encryptedData.data(), static_cast(outlen1 + outlen2)); + m_file.flush(); } /*!