From 3975019b3c5b10b7d676d8b0af726041d5003b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 19 Apr 2017 13:15:19 +0200 Subject: [PATCH] Fix cast from pointer to integer of different size --- examples/felica-read-ndef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/felica-read-ndef.c b/examples/felica-read-ndef.c index 60a9593..189b8d3 100644 --- a/examples/felica-read-ndef.c +++ b/examples/felica-read-ndef.c @@ -125,7 +125,7 @@ main (int argc, char *argv[]) payload_length = ndef_record[2]; payload_length_length = 1; } else { - payload_length = be32toh ((uint32_t) ndef_record + 2); + payload_length = be32toh (*(uint32_t *)(ndef_record + 2)); payload_length_length = 4; } ndef_record_length += payload_length_length;