OSDN Git Service

hciconfig: Fix compiler warnings related to unaligned memory access
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Fri, 10 Feb 2012 21:40:06 +0000 (18:40 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 14 Feb 2012 12:39:15 +0000 (14:39 +0200)
tools/hciconfig.c

index 5d01bd9..f1458b9 100644 (file)
@@ -1305,7 +1305,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt)
                                printf("\t%s service classes:",
                                        type == 0x02 ? "Shortened" : "Complete");
                                for (i = 0; i < (len - 1) / 2; i++) {
-                                       uint16_t val = btohs(bt_get_unaligned((uint16_t *) (ptr + (i * 2))));
+                                       uint16_t val = bt_get_le16((ptr + (i * 2)));
                                        printf(" 0x%4.4x", val);
                                }
                                printf("\n");