From 97b02697cd06e1e4d86308cc36e96225b1e56203 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 28 Dec 2021 00:01:21 +0200 Subject: [PATCH 32/33] Use SIZE_T_PRINTF when printing zstd error value This replaces ugly hack to cast value to long just to be able to use same format specifier on all platforms. See osdn #43399 Signed-off-by: Marko Lindqvist --- utility/ioz.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utility/ioz.c b/utility/ioz.c index 8e83b3b5e8..5247dbbd34 100644 --- a/utility/ioz.c +++ b/utility/ioz.c @@ -1223,11 +1223,13 @@ const char *fz_strerror(fz_FILE *fp) } if (NULL != cleartext) { - fc_snprintf(zstderror, sizeof(zstderror), "ZSTD: \"%s\" (%ld)", - cleartext, (long)fp->u.zstd.error); + fc_snprintf(zstderror, sizeof(zstderror), + "ZSTD: \"%s\" (" SIZE_T_PRINTF ")", + cleartext, fp->u.zstd.error); } else { - fc_snprintf(zstderror, sizeof(zstderror), "ZSTD error %ld", - (long)fp->u.zstd.error); + fc_snprintf(zstderror, sizeof(zstderror), + "ZSTD error " SIZE_T_PRINTF, + fp->u.zstd.error); } return zstderror; } -- 2.34.1