summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-01-06 12:59:57 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-01-06 12:59:57 +0000
commit88e399ec1d771872d9ee895875218a3d3aa2f6ec (patch)
tree448df20b2ac921ae637ed97537f2882de11dec5d /tools
parentb769dcbea87081a6e0010db03a97f163256cd372 (diff)
Allow null-terminated strings
Diffstat (limited to 'tools')
-rw-r--r--tools/sdptool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/sdptool.c b/tools/sdptool.c
index ae2925cc..b3876233 100644
--- a/tools/sdptool.c
+++ b/tools/sdptool.c
@@ -662,11 +662,14 @@ static void print_raw_data(sdp_data_t *data, int indent)
case SDP_TEXT_STR16:
case SDP_TEXT_STR32:
hex = 0;
- for (i = 0; i < data->unitSize; i++)
+ for (i = 0; i < data->unitSize; i++) {
+ if (i == (data->unitSize - 1) && data->val.str[i] == '\0')
+ break;
if (!isprint(data->val.str[i])) {
hex = 1;
break;
}
+ }
if (hex) {
printf("Data");
for (i = 0; i < data->unitSize; i++)