aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-11 16:42:04 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:44:07 +0200
commit5bc99f62015a63df22f72ee9b9396e8881b17d2e (patch)
tree0348e152f92c879ec6782a7f6cc3853eaeffdfc3
parentbac5291e6c102a77a22928b4ee067388ee3a562f (diff)
downloadneard-5bc99f62015a63df22f72ee9b9396e8881b17d2e.tar.gz
nfctype5: use proper format for integers (-Wformat)
Properly print signed and unsigned integers. This fixes warnings like: In file included from plugins/nfctype5.c:29: plugins/nfctype5.c: In function ‘t5_read’: ./include/near/log.h:45:14: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=] 45 | near_debug("%s:%s() " fmt, \ | ^~~~~~~~~~ plugins/nfctype5.c:437:2: note: in expansion of macro ‘DBG’ 437 | DBG("Reading %zd bytes starting at offset %d\n", len, offset); | ^~~ Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r--plugins/nfctype5.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/nfctype5.c b/plugins/nfctype5.c
index 3d2cdf0..0f90e55 100644
--- a/plugins/nfctype5.c
+++ b/plugins/nfctype5.c
@@ -434,7 +434,7 @@ static int t5_read(struct near_tag *tag, uint8_t offset, uint8_t *buf,
uint8_t blk_size = near_tag_get_blk_size(tag);
int err;
- DBG("Reading %zd bytes starting at offset %d\n", len, offset);
+ DBG("Reading %zu bytes starting at offset %u\n", len, offset);
err = t5_cmd_hdr_init(tag, &t5_cmd.hdr, CMD_READ_SINGLE_BLOCK);
if (err)
@@ -532,10 +532,10 @@ static int t5_write(struct near_tag *tag, uint8_t offset, uint8_t *buf,
uint8_t blk_size = near_tag_get_blk_size(tag);
int err;
- DBG("Writing %zd bytes starting at offset %d\n", len, offset);
+ DBG("Writing %zu bytes starting at offset %u\n", len, offset);
if (offset % blk_size) {
- near_error("Write - Invalid offset - offset: %d, blk_size: %d",
+ near_error("Write - Invalid offset - offset: %u, blk_size: %u",
offset, blk_size);
return -EINVAL;
}