Use type casts to size_t for return types of json_object_array_length

This will future proof the code, as it seems
that the next release of json-c will return size_t array lengths
This commit is contained in:
Marius Orcsik 2017-10-27 15:19:15 +02:00
parent e39d663135
commit ccc83f7f76
No known key found for this signature in database
GPG key ID: 889CE8E4FB2D877A
6 changed files with 14 additions and 17 deletions

View file

@ -149,7 +149,7 @@ static void pretty_print_version(json_object *v) {
static void pretty_print_clipboard(json_object *v) {
if (success(v, true)) {
if (json_object_is_type(v, json_type_array)) {
for (int i = 0; i < json_object_array_length(v); ++i) {
for (size_t i = 0; i < (size_t)json_object_array_length(v); ++i) {
json_object *o = json_object_array_get_idx(v, i);
printf("%s\n", json_object_get_string(o));
}