diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2004-07-11 14:59:58 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2004-07-11 14:59:58 +0000 |
commit | 1e13bc53e5970767c23c3987b8b4caef7f939e13 (patch) | |
tree | 834e1582d888bb5165cf491b8bcc4f632a5e09f5 | |
parent | f8139da29790f1b789231ccfacdecfaa794ae4e2 (diff) | |
download | hcidump-1e13bc53e5970767c23c3987b8b4caef7f939e13.tar.gz |
Show config values only when they are present
-rw-r--r-- | parser/l2cap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/parser/l2cap.c b/parser/l2cap.c index 01d621c..3e69e41 100644 --- a/parser/l2cap.c +++ b/parser/l2cap.c @@ -205,13 +205,19 @@ static void conf_opt(int level, void *ptr, int len) switch (h->type) { case L2CAP_CONF_MTU: - printf("MTU %d ", get_val(h->val, h->len)); + printf("MTU "); + if (h->len > 0) + printf("%d ", get_val(h->val, h->len)); break; case L2CAP_CONF_FLUSH_TO: - printf("FlushTO %d ", get_val(h->val, h->len)); + printf("FlushTO "); + if (h->len > 0) + printf("%d ", get_val(h->val, h->len)); break; case 0x04: - printf("Mode %d (%s)", *h->val, mode2str(*h->val)); + printf("Mode "); + if (h->len > 0) + printf("%d (%s) ", *h->val, mode2str(*h->val)); break; default: printf("Unknown (type %2.2x, len %d) ", h->type, h->len); |