mirror of
https://github.com/json-c/json-c.git
synced 2026-04-02 20:09:06 +08:00
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
This commit is contained in:
@@ -288,8 +288,8 @@ const char *json_type_to_name(enum json_type o_type)
|
|||||||
int o_type_int = (int)o_type;
|
int o_type_int = (int)o_type;
|
||||||
if (o_type_int < 0 || o_type_int >= (int)NELEM(json_type_name))
|
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,
|
_json_c_set_last_err("json_type_to_name: type %d is out of range [0,%u]\n", o_type,
|
||||||
NELEM(json_type_name));
|
(unsigned)NELEM(json_type_name));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return json_type_name[o_type];
|
return json_type_name[o_type];
|
||||||
|
|||||||
Reference in New Issue
Block a user