summaryrefslogtreecommitdiff
path: root/lib/comp/zstd.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2019-07-23 13:22:56 -0700
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-24 09:17:30 +0200
commit4b0c21183e1a29f3bb5eb8af4d13467e05f6d36b (patch)
tree75ba7a23d64e52db049a4d95da6cfd489d1a1325 /lib/comp/zstd.c
parent05a30292f9d2be63af3b4c27d5ae89801da602a2 (diff)
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 <mattst88@gmail.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/comp/zstd.c')
-rw-r--r--lib/comp/zstd.c6
1 files changed, 4 insertions, 2 deletions
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;
}