ZSTD errors are negative numbers, printing these as %zu is
hard to read.
Use ZSTD_getErrorName() to get an easier error
Signed-off-by: Dominique Martinet <
dominique...@atmark-techno.com>
---
(I stumbled on this because I had regenerated an encryption key
but not sent it to device, so decompression failed -- quite annoying
that we can't detect the aes key was wrong until decrpytion is finalized
but I don't see any way around it... Anyway, it won't hurt to have
readable errors, "Unknown frame descriptor" is slightly better than
"returned 18446744073709551606")
core/cpio_utils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/cpio_utils.c b/core/cpio_utils.c
index b4131edc9525..67cc8055cac3 100644
--- a/core/cpio_utils.c
+++ b/core/cpio_utils.c
@@ -364,7 +364,8 @@ static int zstd_step(void* state, void* buffer, size_t size)
decompress_ret = ZSTD_decompressStream(s->dctx, &output, &s->input_view);
if (ZSTD_isError(decompress_ret)) {
- ERROR("ZSTD_decompressStream failed (returned %zu)", decompress_ret);
+ ERROR("ZSTD_decompressStream failed: %s",
+ ZSTD_getErrorName(decompress_ret));
return -1;
}
--
2.30.2