From ffde4d4d92a567329cc7ca4a896551c637269e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 16 Apr 2014 02:25:54 +0200 Subject: [PATCH] Fix mifare_desfire_get_[iso_]file_ids() prototype. The "files" parameter is not an array of pointer to uint8_t (uint8_t *files[]), but rather an pointer to an array of uint8_t (uint8_t (*files)[]). Since this syntax confuses the compiler (the program attempt to assign a value to what "files" is pointing to, which is supposed to be an array, which is not assignable), declare "files" as a pointer to a pointer to uint8_t (uint8_t **files) which makes everybody happy. Fixes issue 26. --- libfreefare/freefare.h | 4 ++-- libfreefare/mifare_desfire.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libfreefare/freefare.h b/libfreefare/freefare.h index b751d5f..460ecce 100644 --- a/libfreefare/freefare.h +++ b/libfreefare/freefare.h @@ -354,8 +354,8 @@ int mifare_desfire_set_configuration (MifareTag tag, bool disable_format, bool int mifare_desfire_set_default_key (MifareTag tag, MifareDESFireKey key); int mifare_desfire_set_ats (MifareTag tag, uint8_t *ats); int mifare_desfire_get_card_uid (MifareTag tag, char **uid); -int mifare_desfire_get_file_ids (MifareTag tag, uint8_t *files[], size_t *count); -int mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t *files[], size_t *count); +int mifare_desfire_get_file_ids (MifareTag tag, uint8_t **files, size_t *count); +int mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t **files, size_t *count); int mifare_desfire_get_file_settings (MifareTag tag, uint8_t file_no, struct mifare_desfire_file_settings *settings); int mifare_desfire_change_file_settings (MifareTag tag, uint8_t file_no, uint8_t communication_settings, uint16_t access_rights); int mifare_desfire_create_std_data_file (MifareTag tag, uint8_t file_no, uint8_t communication_settings, uint16_t access_rights, uint32_t file_size); diff --git a/libfreefare/mifare_desfire.c b/libfreefare/mifare_desfire.c index edf1707..a117b99 100644 --- a/libfreefare/mifare_desfire.c +++ b/libfreefare/mifare_desfire.c @@ -1160,7 +1160,7 @@ mifare_desfire_get_card_uid (MifareTag tag, char **uid) /* Application level commands */ int -mifare_desfire_get_file_ids (MifareTag tag, uint8_t *files[], size_t *count) +mifare_desfire_get_file_ids (MifareTag tag, uint8_t **files, size_t *count) { ASSERT_ACTIVE (tag); ASSERT_MIFARE_DESFIRE (tag); @@ -1193,7 +1193,7 @@ mifare_desfire_get_file_ids (MifareTag tag, uint8_t *files[], size_t *count) } int -mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t *files[], size_t *count) +mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t **files, size_t *count) { ASSERT_ACTIVE (tag); ASSERT_MIFARE_DESFIRE (tag);