diff options
| author | 2017-02-05 15:57:45 +0100 | |
|---|---|---|
| committer | 2017-02-05 15:57:45 +0100 | |
| commit | ca75d9fffd633e42b2fe8b12031a25867108856f (patch) | |
| tree | 5c8886be6dff26d747f6530123ec2db7f118f5a6 /src/bplist.c | |
| parent | 31d7cc5370f37cc6b9ecc4e26256e74634554343 (diff) | |
| download | libplist-ca75d9fffd633e42b2fe8b12031a25867108856f.tar.gz libplist-ca75d9fffd633e42b2fe8b12031a25867108856f.tar.bz2 | |
bplist: Suppress compiler warnings about format specifiers in error messages
Diffstat (limited to 'src/bplist.c')
| -rw-r--r-- | src/bplist.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/bplist.c b/src/bplist.c index 73202ff..cc0b928 100644 --- a/src/bplist.c +++ b/src/bplist.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <string.h> | 29 | #include <string.h> |
| 30 | 30 | ||
| 31 | #include <ctype.h> | 31 | #include <ctype.h> |
| 32 | #include <inttypes.h> | ||
| 32 | 33 | ||
| 33 | #include <plist/plist.h> | 34 | #include <plist/plist.h> |
| 34 | #include "plist.h" | 35 | #include "plist.h" |
| @@ -416,7 +417,7 @@ static plist_t parse_dict_node(struct bplist_data *bplist, const char** bnode, u | |||
| 416 | if ((index1_ptr < bplist->data || index1_ptr + bplist->ref_size > bplist->offset_table) || | 417 | if ((index1_ptr < bplist->data || index1_ptr + bplist->ref_size > bplist->offset_table) || |
| 417 | (index2_ptr < bplist->data || index2_ptr + bplist->ref_size > bplist->offset_table)) { | 418 | (index2_ptr < bplist->data || index2_ptr + bplist->ref_size > bplist->offset_table)) { |
| 418 | plist_free(node); | 419 | plist_free(node); |
| 419 | PLIST_BIN_ERR("%s: dict entry %llu is outside of valid range\n", __func__, j); | 420 | PLIST_BIN_ERR("%s: dict entry %" PRIu64 " is outside of valid range\n", __func__, j); |
| 420 | return NULL; | 421 | return NULL; |
| 421 | } | 422 | } |
| 422 | 423 | ||
| @@ -425,12 +426,12 @@ static plist_t parse_dict_node(struct bplist_data *bplist, const char** bnode, u | |||
| 425 | 426 | ||
| 426 | if (index1 >= bplist->num_objects) { | 427 | if (index1 >= bplist->num_objects) { |
| 427 | plist_free(node); | 428 | plist_free(node); |
| 428 | PLIST_BIN_ERR("%s: dict entry %llu key index (%llu) must be smaller than the number of objects (%llu)\n", __func__, j, index1, bplist->num_objects); | 429 | PLIST_BIN_ERR("%s: dict entry %" PRIu64 " key index (%" PRIu64 ") must be smaller than the number of objects (%" PRIu64 ")\n", __func__, j, index1, bplist->num_objects); |
| 429 | return NULL; | 430 | return NULL; |
| 430 | } | 431 | } |
| 431 | if (index2 >= bplist->num_objects) { | 432 | if (index2 >= bplist->num_objects) { |
| 432 | plist_free(node); | 433 | plist_free(node); |
| 433 | PLIST_BIN_ERR("%s: dict entry %llu value index (%llu) must be smaller than the number of objects (%llu)\n", __func__, j, index1, bplist->num_objects); | 434 | PLIST_BIN_ERR("%s: dict entry %" PRIu64 " value index (%" PRIu64 ") must be smaller than the number of objects (%" PRIu64 ")\n", __func__, j, index1, bplist->num_objects); |
| 434 | return NULL; | 435 | return NULL; |
| 435 | } | 436 | } |
| 436 | 437 | ||
| @@ -490,7 +491,7 @@ static plist_t parse_array_node(struct bplist_data *bplist, const char** bnode, | |||
| 490 | 491 | ||
| 491 | if (index1_ptr < bplist->data || index1_ptr + bplist->ref_size > bplist->offset_table) { | 492 | if (index1_ptr < bplist->data || index1_ptr + bplist->ref_size > bplist->offset_table) { |
| 492 | plist_free(node); | 493 | plist_free(node); |
| 493 | PLIST_BIN_ERR("%s: array item %llu is outside of valid range\n", __func__, j); | 494 | PLIST_BIN_ERR("%s: array item %" PRIu64 " is outside of valid range\n", __func__, j); |
| 494 | return NULL; | 495 | return NULL; |
| 495 | } | 496 | } |
| 496 | 497 | ||
| @@ -498,7 +499,7 @@ static plist_t parse_array_node(struct bplist_data *bplist, const char** bnode, | |||
| 498 | 499 | ||
| 499 | if (index1 >= bplist->num_objects) { | 500 | if (index1 >= bplist->num_objects) { |
| 500 | plist_free(node); | 501 | plist_free(node); |
| 501 | PLIST_BIN_ERR("%s: array item %llu object index (%llu) must be smaller than the number of objects (%llu)\n", __func__, j, index1, bplist->num_objects); | 502 | PLIST_BIN_ERR("%s: array item %" PRIu64 " object index (%" PRIu64 ") must be smaller than the number of objects (%" PRIu64 ")\n", __func__, j, index1, bplist->num_objects); |
| 502 | return NULL; | 503 | return NULL; |
| 503 | } | 504 | } |
| 504 | 505 | ||
| @@ -521,7 +522,7 @@ static plist_t parse_uid_node(const char **bnode, uint8_t size) | |||
| 521 | size = size + 1; | 522 | size = size + 1; |
| 522 | data->intval = UINT_TO_HOST(*bnode, size); | 523 | data->intval = UINT_TO_HOST(*bnode, size); |
| 523 | if (data->intval > UINT32_MAX) { | 524 | if (data->intval > UINT32_MAX) { |
| 524 | PLIST_BIN_ERR("%s: value %llu too large for UID node (must be <= %u)\n", __func__, (uint64_t)data->intval, UINT32_MAX); | 525 | PLIST_BIN_ERR("%s: value %" PRIu64 " too large for UID node (must be <= %u)\n", __func__, (uint64_t)data->intval, UINT32_MAX); |
| 525 | free(data); | 526 | free(data); |
| 526 | return NULL; | 527 | return NULL; |
| 527 | } | 528 | } |
| @@ -687,7 +688,7 @@ static plist_t parse_bin_node_at_index(struct bplist_data *bplist, uint32_t node | |||
| 687 | const char* idx_ptr = NULL; | 688 | const char* idx_ptr = NULL; |
| 688 | 689 | ||
| 689 | if (node_index >= bplist->num_objects) { | 690 | if (node_index >= bplist->num_objects) { |
| 690 | PLIST_BIN_ERR("node index (%u) must be smaller than the number of objects (%llu)\n", node_index, bplist->num_objects); | 691 | PLIST_BIN_ERR("node index (%u) must be smaller than the number of objects (%" PRIu64 ")\n", node_index, bplist->num_objects); |
| 691 | return NULL; | 692 | return NULL; |
| 692 | } | 693 | } |
| 693 | 694 | ||
| @@ -788,7 +789,7 @@ PLIST_API void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * | |||
| 788 | } | 789 | } |
| 789 | 790 | ||
| 790 | if (root_object >= num_objects) { | 791 | if (root_object >= num_objects) { |
| 791 | PLIST_BIN_ERR("root object index (%llu) must be smaller than number of objects (%llu)\n", root_object, num_objects); | 792 | PLIST_BIN_ERR("root object index (%" PRIu64 ") must be smaller than number of objects (%" PRIu64 ")\n", root_object, num_objects); |
| 792 | return; | 793 | return; |
| 793 | } | 794 | } |
| 794 | 795 | ||
