diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-08-05 07:33:57 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-08-05 07:33:57 +0000 |
commit | 9409e3e8e152290e253889df6922c56ef606b62b (patch) | |
tree | bcf42735e99217f356311014a822e7d64e558468 /src/hci.c | |
parent | a73893381f0b7be98b8eb99d31ff834c7658d27c (diff) | |
download | bluez-9409e3e8e152290e253889df6922c56ef606b62b.tar.gz |
Update lmp_featurestostr() function
Diffstat (limited to 'src/hci.c')
-rw-r--r-- | src/hci.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |