From 09015c212f555134f988d4d0245555081a25a959 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Sun, 20 Oct 2019 20:37:30 -0700 Subject: [PATCH] Use correct format string when printing int8 Reviewed-by: Igor Kozhukhov Reviewed-by: Ryan Moeller Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Closes #9486 --- lib/libnvpair/libnvpair_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libnvpair/libnvpair_json.c b/lib/libnvpair/libnvpair_json.c index 0b403f1af..37a392391 100644 --- a/lib/libnvpair/libnvpair_json.c +++ b/lib/libnvpair/libnvpair_json.c @@ -303,7 +303,7 @@ nvlist_print_json(FILE *fp, nvlist_t *nvl) for (i = 0; i < valsz; i++) { if (i > 0) FPRINTF(fp, ","); - FPRINTF(fp, "%hd", val[i]); + FPRINTF(fp, "%hhd", val[i]); } FPRINTF(fp, "]"); break;