From c04e0056db8c4a8dc02b87fb647e300b26ccb207 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 29 Aug 2007 14:32:55 +0000 Subject: Fix supported commands bit calculation --- src/hci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index d3e81d2c..54e57cf3 100644 --- a/src/hci.c +++ b/src/hci.c @@ -515,7 +515,7 @@ char *hci_commandstostr(uint8_t *commands, char *pref, int width) m = commands_map; while (m->str) { - if (hci_test_bit(m->val, commands)) + if (commands[m->val / 8] & (1 << (m->val % 8))) size += strlen(m->str) + (pref ? strlen(pref) : 0) + 3; m++; } @@ -534,7 +534,7 @@ char *hci_commandstostr(uint8_t *commands, char *pref, int width) m = commands_map; while (m->str) { - if (hci_test_bit(m->val, commands)) { + if (commands[m->val / 8] & (1 << (m->val % 8))) { if (strlen(off) + strlen(m->str) > width - 3) { ptr += sprintf(ptr, "\n%s", pref ? pref : ""); off = ptr; -- cgit