From 019174128cdc986c2c726fe40b0b1ceacde6c57a Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Sun, 1 Jan 2023 19:40:23 +0100 Subject: [PATCH] fix: COMPRESSION --- src/misc/Compression.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/Compression.cpp b/src/misc/Compression.cpp index 4a26e77..12bdb1a 100644 --- a/src/misc/Compression.cpp +++ b/src/misc/Compression.cpp @@ -9,13 +9,13 @@ namespace td { namespace utils { std::uint64_t Inflate(const std::string& source, std::string& dest) { - std::size_t size; + uLongf size = dest.size(); uncompress(reinterpret_cast(dest.data()), reinterpret_cast(&size), reinterpret_cast(source.c_str()), source.length()); return size; } std::uint64_t Deflate(const std::string& source, std::string& dest) { - std::size_t size; + uLongf size = source.length(); dest.resize(source.size()); // Resize for the compressed data to fit into compress(reinterpret_cast(dest.data()), reinterpret_cast(&size), reinterpret_cast(source.c_str()), source.length()); dest.resize(size); // Resize to cut useless data