From: Even Rouault Date: Sun, 16 Jan 2022 19:48:27 +0000 (+0100) Subject: json_type_to_name(): use correct printf() formatter X-Git-Tag: json-c-0.16-20220414~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F741%2Fhead;p=thirdparty%2Fjson-c.git json_type_to_name(): use correct printf() formatter Was detected by Coverity Scan when analyzing GDAL's code base which has a copy of json-c --- diff --git a/json_util.c b/json_util.c index 4312458c..a65adc04 100644 --- a/json_util.c +++ b/json_util.c @@ -288,8 +288,8 @@ const char *json_type_to_name(enum json_type o_type) int o_type_int = (int)o_type; if (o_type_int < 0 || o_type_int >= (int)NELEM(json_type_name)) { - _json_c_set_last_err("json_type_to_name: type %d is out of range [0,%d]\n", o_type, - NELEM(json_type_name)); + _json_c_set_last_err("json_type_to_name: type %d is out of range [0,%u]\n", o_type, + (unsigned)NELEM(json_type_name)); return NULL; } return json_type_name[o_type];