summaryrefslogtreecommitdiffstats
path: root/src/hci.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-08-05 07:33:57 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-08-05 07:33:57 +0000
commit9409e3e8e152290e253889df6922c56ef606b62b (patch)
treebcf42735e99217f356311014a822e7d64e558468 /src/hci.c
parenta73893381f0b7be98b8eb99d31ff834c7658d27c (diff)
Update lmp_featurestostr() function
Diffstat (limited to 'src/hci.c')
-rw-r--r--src/hci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hci.c b/src/hci.c
index 2447ae9b..c42d81c4 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -411,13 +411,13 @@ static hci_map lmp_features_map[8][9] = {
char *lmp_featurestostr(uint8_t *features, char *pref, int width)
{
char *off, *ptr, *str;
- int i, size = 0;
+ int i, size = 10;
for (i = 0; i < 8; i++) {
hci_map *m = lmp_features_map[i];
while (m->str) {
- if ((unsigned int) m->val & (unsigned int) features[i])
+ if (m->val & features[i])
size += strlen(m->str) + (pref ? strlen(pref) : 0) + 1;
m++;
}
@@ -427,7 +427,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width)
if (!str)
return NULL;
- ptr = str; *ptr = 0;
+ ptr = str; *ptr = '\0';
if (pref)
ptr += sprintf(ptr, "%s", pref);
@@ -438,7 +438,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width)
hci_map *m = lmp_features_map[i];
while (m->str) {
- if ((unsigned int) m->val & (unsigned int) features[i]) {
+ if (m->val & features[i]) {
if (strlen(off) + strlen(m->str) > width - 1) {
ptr += sprintf(ptr, "\n%s", pref ? pref : "");
off = ptr;