Browse Source

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
tags/json-c-0.16-20220414
Even Rouault 3 years ago
parent
commit
f2c0df404b
No known key found for this signature in database GPG Key ID: 33EBBFC47B3DD87D
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      json_util.c

+ 2
- 2
json_util.c View File

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


Loading…
Cancel
Save