public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [PATCH] Fix some bugs in hcidump.
Date: Mon, 23 Feb 2004 03:18:41 +0000	[thread overview]
Message-ID: <40397111.7000903@superbug.demon.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 109 bytes --]

Attached is a patch to apply to bluez-hcidump-1.5/parser/sdp.c

It fixes some of the printout.

Cheers
James

[-- Attachment #2: sdp.c.diff --]
[-- Type: text/x-patch, Size: 1441 bytes --]

--- sdp.c.org	2004-02-23 02:56:03.667767736 +0000
+++ sdp.c	2004-02-23 03:15:48.787602136 +0000
@@ -324,6 +324,7 @@
 	printf("pat");
 
 	if (parse_de_hdr(frm, &n1) == SDP_DE_SEQ) {
+	        len = frm->len;
 		while (len - frm->len < n1 ) {
 			if (parse_de_hdr(frm,&n2) == SDP_DE_UUID) {
 				print_uuid(n2, frm);
@@ -351,7 +352,8 @@
 	printf("aid(s)");
 
 	if (parse_de_hdr(frm, &n1) == SDP_DE_SEQ) {
-		while (len - frm->len <= n1 ) {
+                len = frm->len;
+		while (len - frm->len < n1 ) {
 			/* Print AttributeID */
 			if (parse_de_hdr(frm, &n2) == SDP_DE_UINT) {
 				switch(n2) {
@@ -367,13 +369,13 @@
 					break;
 				}
 			} else {
-				printf("\nERROR: Unexpected syntax\n");
+				printf("\nERROR: Unexpected syntax: (aid)\n");
 				raw_dump(level, frm);
 			}
 		}
 		printf("\n");
 	} else {
-		printf("\nERROR: Unexpected syntax\n");
+		printf("\nERROR: Unexpected syntax: (aid)\n");
 		raw_dump(level, frm);
 	}
 }
@@ -385,6 +387,7 @@
 	int   len = frm->len;
 
 	if (parse_de_hdr(frm, &n1) == SDP_DE_SEQ) {
+	        len = frm->len;
 		while (len - frm->len < n1 ) {
 			/* Print AttributeID */
 			if ((parse_de_hdr(frm, &n2) == SDP_DE_UINT) &&
@@ -426,7 +429,7 @@
 	int   cnt = 0;
 
 	if (parse_de_hdr(frm, &n) == SDP_DE_SEQ) {
-	printf(" len 0x%x frm->len 0x%x n 0x%x\n", len, frm->len, n);
+	        len = frm->len;
 		while (len - frm->len < n ) {
 			p_indent(level, 0);
 			printf("srv rec #%d\n", cnt++);

             reply	other threads:[~2004-02-23  3:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-23  3:18 James Courtier-Dutton [this message]
2004-02-23  7:42 ` [Bluez-devel] [PATCH] Fix some bugs in hcidump Marcel Holtmann
2004-02-23 13:41   ` James Courtier-Dutton
2004-02-23 14:04     ` Marcel Holtmann
2004-02-23 15:04       ` James Courtier-Dutton
2004-02-23 17:39         ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40397111.7000903@superbug.demon.co.uk \
    --to=james@superbug.demon.co.uk \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox