Mercurial > hg > orthanc
comparison Core/Compression/GzipCompressor.cpp @ 3378:596cfabd72c5
Fixed a couple of truncation warnings
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 17 May 2019 08:36:18 +0200 |
parents | 4e43e67f8ecf |
children | 94f4a18a79cc |
comparison
equal
deleted
inserted
replaced
3377:05881bf99c83 | 3378:596cfabd72c5 |
---|---|
89 | 89 |
90 void GzipCompressor::Compress(std::string& compressed, | 90 void GzipCompressor::Compress(std::string& compressed, |
91 const void* uncompressed, | 91 const void* uncompressed, |
92 size_t uncompressedSize) | 92 size_t uncompressedSize) |
93 { | 93 { |
94 uLongf compressedSize = compressBound(uncompressedSize) + 1024 /* security margin */; | 94 uLongf compressedSize = compressBound(static_cast<uLong>(uncompressedSize)) |
95 + 1024 /* security margin */; | |
96 | |
95 if (compressedSize == 0) | 97 if (compressedSize == 0) |
96 { | 98 { |
97 compressedSize = 1; | 99 compressedSize = 1; |
98 } | 100 } |
99 | 101 |