From aee56b92556f3ac82c0033e631ee2cdc77c87a2f Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Sat, 2 Mar 2013 13:08:03 +0100 Subject: [PATCH] Initialize variables Fix compiler warnings and potential bug pn53x.c:1526:19: warning: The right operand of '<' is a garbage value for (i = 0; i < sz; i++) { ^ ~~ pn53x.c:1621:19: warning: The right operand of '<' is a garbage value for (i = 0; i < sz; i++) { ^ ~~ --- libnfc/chips/pn53x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 8ccccca..5e18e7a 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1456,7 +1456,7 @@ pn53x_initiator_transceive_bits_timed(struct nfc_device *pnd, const uint8_t *pbt (void) pbtTxPar; (void) pbtRxPar; uint16_t i; - uint8_t sz; + uint8_t sz = 0; int res = 0; size_t szRxBits = 0; @@ -1555,7 +1555,7 @@ int pn53x_initiator_transceive_bytes_timed(struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx, const size_t szRx, uint32_t *cycles) { uint16_t i; - uint8_t sz; + uint8_t sz = 0; int res = 0; // We can not just send bytes without parity while the PN53X expects we handled them