summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-01-21 17:33:06 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-03-11 11:40:10 +0200
commitf9cd4a1871ff0765cc5c03a2c21f9d2f7d9262c7 (patch)
tree4145262ef3cd6a929610c012b73ac02380f35a41
parentb36f7cd78806c2738bcdf727d6d97f473f42f80e (diff)
downloadbluez-f9cd4a1871ff0765cc5c03a2c21f9d2f7d9262c7.tar.gz
monitor/avctp: Print <empty> if folder lenght is 0
This is a bit more clear that is was not a parsing error but just that there is nothing to print: > ACL Data RX: Handle 256 flags 0x02 dlen 39 Channel: 68 len 35 ctrl 0x0304 [PSM 27 mode 3] {chan 4} I-frame: Unsegmented TxSeq 2 ReqSeq 3 AVCTP Browsing: Response: type 0x00 label 2 PID 0x110e AVRCP: SetBrowsedPlayer: len 0x0019 Status: 0x04 (Success) UIDCounter: 0x0000 (0) Number of Items: 0x00000002 (2) CharsetID: 0x006a (UTF-8) Folder Depth: 0x01 (1) Folder: <empty>
-rw-r--r--monitor/avctp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/monitor/avctp.c b/monitor/avctp.c
index a024a0fcd..81e91668e 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -2430,7 +2430,12 @@ response:
if (!l2cap_frame_get_u8(frame, &len))
return false;
- printf("Folder: ");
+ if (!len) {
+ print_field("%*cFolder: <empty>", indent, ' ');
+ continue;
+ }
+
+ printf("%*cFolder: ", indent+8, ' ');
for (; len > 0; len--) {
uint8_t c;