summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2013-03-25 11:47:55 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-03-28 16:35:37 +0100
commit28f331da1d1a4e782f17f0d5cf166ada51635143 (patch)
tree6c54dafb5f53bfea4f7c219d6ba24e4de418c7d0
parentf2ed62998c94a8d2621e0e41ae39cd3d1f316305 (diff)
downloadneard-28f331da1d1a4e782f17f0d5cf166ada51635143.tar.gz
neard-28f331da1d1a4e782f17f0d5cf166ada51635143.tar.bz2
neard-28f331da1d1a4e782f17f0d5cf166ada51635143.zip
snep-validation: Fix compilation on ARM due to unaligned memory access
Use near_get_be32 helper function to access nfc_data. Although there is most likely no risk of unaligned access since nfc_data is allocated from heap (and properly alligned as access starts from first byte) this result in compilation error on ARM (Debian GCC 4.6.3). plugins/snep-validation.c: In function ‘snep_validation_server_req_get’: plugins/snep-validation.c:155:22: error: cast increases required alignment of target type [-Werror=cast-align] cc1: all warnings being treated as errors make[1]: *** [plugins/snep-validation.o] Error 1 make: *** [all] Error 2
-rw-r--r--plugins/snep-validation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/snep-validation.c b/plugins/snep-validation.c
index 2094630..682a090 100644
--- a/plugins/snep-validation.c
+++ b/plugins/snep-validation.c
@@ -152,7 +152,7 @@ static near_bool_t snep_validation_server_req_get(int client_fd, void *data)
/* check if the acceptable length is higher than the data_len
* otherwise returns a NEAR_SNEP_RESP_EXCESS
*/
- acceptable_length = GUINT32_FROM_BE(*(uint32_t *)snep_data->nfc_data);
+ acceptable_length = near_get_be32(snep_data->nfc_data);
/* Look if there are some incoming ndef stored */
incoming_ndefs = g_hash_table_lookup(snep_validation_hash,