aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-11 16:43:33 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:44:07 +0200
commitc4b1bc196ffd3313aa96a35b9db70c8fbc26ad9b (patch)
tree965b3744c4fed6609162601cd176d54972fe0541
parentb5c84a426d9ffda5e886f7620b286e2a4350ae87 (diff)
downloadneard-c4b1bc196ffd3313aa96a35b9db70c8fbc26ad9b.tar.gz
mifare: use proper format for integers (-Wformat)
Properly print signed and unsigned integers. This fixes warnings like: plugins/mifare.c: In function ‘mifare_read’: plugins/mifare.c:836:33: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘unsigned int’ [-Werror=format=] 836 | near_error("Mifare tag type [%d] not supported.", tgt_subtype); | ~^ ~~~~~~~~~~~ | | | | int unsigned int | %d Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r--plugins/mifare.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mifare.c b/plugins/mifare.c
index 3d37652..a4e4ba4 100644
--- a/plugins/mifare.c
+++ b/plugins/mifare.c
@@ -833,7 +833,7 @@ int mifare_read(uint32_t adapter_idx, uint32_t target_idx,
case NEAR_TAG_NFC_T2_MIFARE_CLASSIC_4K:
break;
default:
- near_error("Mifare tag type [%d] not supported.", tgt_subtype);
+ near_error("Mifare tag type [%u] not supported.", tgt_subtype);
return -1;
}
@@ -900,7 +900,7 @@ int mifare_check_presence(uint32_t adapter_idx, uint32_t target_idx,
case NEAR_TAG_NFC_T2_MIFARE_CLASSIC_4K:
break;
default:
- near_error("Mifare tag type %d not supported.", tgt_subtype);
+ near_error("Mifare tag type %u not supported.", tgt_subtype);
return -1;
}
@@ -1228,7 +1228,7 @@ static int writing_not_permitted(void *data)
}
}
- DBG("TAG writable sectors' size: [%d].", new_tag_size);
+ DBG("TAG writable sectors' size: [%u].", new_tag_size);
/* Check if there's enough space on tag */
if (new_tag_size < mf_ck->ndef->length) {
@@ -1293,7 +1293,7 @@ int mifare_write(uint32_t adapter_idx, uint32_t target_idx,
case NEAR_TAG_NFC_T2_MIFARE_CLASSIC_4K:
break;
default:
- near_error("Mifare tag type %d not supported.", tgt_subtype);
+ near_error("Mifare tag type %u not supported.", tgt_subtype);
return -1;
}