From 7c619b6d6235c5ad4154f9d44883b154bc49fb11 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 9 Jun 2018 18:34:46 +0200 Subject: [PATCH] Fix error message for compression --- io/passwordfile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index bd3f0c6..f3d1436 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -252,8 +252,8 @@ void PasswordFile::load() * \param useEncryption Specifies whether encryption should be used. * \param useCompression Specifies whether compression should be used. * \throws Throws ios_base::failure when an IO error occurs. - * \throws Throws runtime_error when no root entry is present. - * \throws Throws Io::CryptoException when a decryption error occurs. + * \throws Throws runtime_error when no root entry is present or a compression error occurs. + * \throws Throws Io::CryptoException when an encryption error occurs. */ void PasswordFile::save(bool useEncryption, bool useCompression) { @@ -306,9 +306,9 @@ void PasswordFile::save(bool useEncryption, bool useCompression) ConversionUtilities::LE::getBytes(static_cast(size), encbuff.data()); switch (compress(reinterpret_cast(encbuff.data() + 8), &compressedSize, reinterpret_cast(decbuff.data()), size)) { case Z_MEM_ERROR: - throw runtime_error("Decompressing failed. The source buffer was too small."); + throw runtime_error("Compressing failed. The source buffer was too small."); case Z_BUF_ERROR: - throw runtime_error("Decompressing failed. The destination buffer was too small."); + throw runtime_error("Compressing failed. The destination buffer was too small."); case Z_OK: encbuff.swap(decbuff); // decompression successful size = 8 + compressedSize;