1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-04 10:44:46 +02:00

We should check only negative return values

This commit is contained in:
Arthur Zakirov 2018-11-08 18:13:42 +03:00
parent cf6e7445e5
commit a0ec849b4a

View File

@ -69,7 +69,7 @@ do_compress(void* dst, size_t dst_size, void const* src, size_t src_size,
{
int32 ret;
ret = zlib_compress(dst, dst_size, src, src_size, level);
if (ret != Z_OK && errormsg)
if (ret < Z_OK && errormsg)
*errormsg = zError(ret);
return ret;
}
@ -99,7 +99,7 @@ do_decompress(void* dst, size_t dst_size, void const* src, size_t src_size,
{
int32 ret;
ret = zlib_decompress(dst, dst_size, src, src_size);
if (ret != Z_OK && errormsg)
if (ret < Z_OK && errormsg)
*errormsg = zError(ret);
return ret;
}