Diff between 5b7511dcfb3c5b44907575e5e43d926a8c406bf1 and 982ee6499b76b21e1a7e601d02dff1c54b08c48d
Changed Files
| File | Additions | Deletions | Status |
| test/hciemu.c | +2 | -1 | modified |
Full Patch
diff --git a/test/hciemu.c b/test/hciemu.c
index 260e29a..4c62223 100644
--- a/test/hciemu.c
+++ b/test/hciemu.c
@@ -1109,10 +1109,11 @@ static int getbdaddrbyname(char *str, bdaddr_t *ba)
if (n == 0) {
/* loopback port */
in_addr_t addr = INADDR_LOOPBACK;
+ uint16_t be16 = htons(atoi(str));
bdaddr_t b;
memcpy(&b, &addr, 4);
- *(uint16_t *) (&b.b[4]) = htons(atoi(str));
+ memcpy(&b.b[4], &be16, sizeof(be16));
baswap(ba, &b);
return 0;