From 4b0c21183e1a29f3bb5eb8af4d13467e05f6d36b Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 23 Jul 2019 13:22:56 -0700 Subject: Include the reason ZSTD gave us for the error Without it you're left guessing or using a debugger to figure out what's wrong. Signed-off-by: Matt Turner Signed-off-by: David Oberhollenzer --- lib/comp/zstd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/comp/zstd.c b/lib/comp/zstd.c index bc94b2d..8fa931b 100644 --- a/lib/comp/zstd.c +++ b/lib/comp/zstd.c @@ -58,7 +58,8 @@ static ssize_t zstd_comp_block(compressor_t *base, const uint8_t *in, zstd->level); if (ZSTD_isError(ret)) { - fputs("internal error in ZSTD compressor\n", stderr); + fprintf(stderr, "internal error in ZSTD compressor: %s\n", + ZSTD_getErrorName(ret)); return -1; } @@ -74,7 +75,8 @@ static ssize_t zstd_uncomp_block(compressor_t *base, const uint8_t *in, ret = ZSTD_decompress(out, outsize, in, size); if (ZSTD_isError(ret)) { - fputs("error uncompressing ZSTD compressed data", stderr); + fprintf(stderr, "error uncompressing ZSTD compressed data: %s", + ZSTD_getErrorName(ret)); return -1; } -- cgit v1.2.3