Use correct format string when printing int8

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9486
This commit is contained in:
Matthew Macy 2019-10-20 20:37:30 -07:00 committed by Tony Hutter
parent 601dd2a504
commit 09015c212f

View File

@ -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;