Thread (21 messages) 21 messages, 2 authors, 2012-09-03

Re: [RFC v2 15/15] hciemu: Fix build errors due to unaligned memory access

flat view

From: Szymon Janc <hidden>
Date: 2012-09-03 06:42:37

On Friday 31 of August 2012 18:19:59 Anderson Lizardo wrote:
Hi  Szymon,
Hi Anderson,
On Fri, Aug 31, 2012 at 8:40 AM, Szymon Janc [off-list ref] wrote:
quoted
--- a/test/hciemu.c
+++ b/test/hciemu.c
@@ -426,8 +426,10 @@ static void num_completed_pkts(struct vhci_conn *conn)
        np = (void *) ptr; ptr += EVT_NUM_COMP_PKTS_SIZE;
        np->num_hndl = 1;

-       *((uint16_t *) ptr) = htobs(conn->handle); ptr += 2;
-       *((uint16_t *) ptr) = htobs(vdev.acl_cnt); ptr += 2;
+       bt_put_be16(conn->handle, ptr);
+       ptr += 2;
+       bt_put_be16(vdev.acl_cnt, ptr);
+       ptr += 2;
These should be bt_put_le16().
Will fix that in next version.
Thx for spotting this!
Regards,
-- 
BR
Szymon Janc
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help