Skip to content

Commit

Permalink
tools/hcidump: Fix parsing of Search PDU
Browse files Browse the repository at this point in the history
  • Loading branch information
Vudentz committed Jun 13, 2013
1 parent bb8f733 commit cf00b35
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/parser/avrcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,15 +2108,15 @@ static void avrcp_search_dump(int level, struct frame *frm, uint8_t hdr,
uint16_t len)
{
uint32_t uidcounter, items;
uint16_t charset;
uint8_t namelen, status;
uint16_t charset, namelen;
uint8_t status;

p_indent(level, frm);

if (hdr & 0x02)
goto response;

if (len < 3) {
if (len < 4) {
printf("PDU Malformed\n");
raw_dump(level, frm);
return;
Expand All @@ -2127,8 +2127,8 @@ static void avrcp_search_dump(int level, struct frame *frm, uint8_t hdr,

p_indent(level, frm);

namelen = get_u8(frm);
printf("Length: 0x%02x (%u)\n", namelen, namelen);
namelen = get_u16(frm);
printf("Length: 0x%04x (%u)\n", namelen, namelen);

p_indent(level, frm);

Expand All @@ -2137,6 +2137,7 @@ static void avrcp_search_dump(int level, struct frame *frm, uint8_t hdr,
uint8_t c = get_u8(frm);
printf("%1c", isprint(c) ? c : '.');
}
printf("\n");

return;

Expand Down

0 comments on commit cf00b35

Please sign in to comment.