Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/7] obexd/MAP: Fix sending \0 after filler byte
Date: Wed,  9 Oct 2013 14:11:40 +0300	[thread overview]
Message-ID: <1381317105-10729-2-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1381317105-10729-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

It is not necessary to append \0 after the filler byte (0x30), the spec
just talk about the a byte not bytes.
---
 obexd/client/map.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index 4373d74..9d90a92 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -729,7 +729,7 @@ static void set_status(const GDBusPropertyTable *property,
 	gboolean value;
 	GError *err = NULL;
 	GObexApparam *apparam;
-	char contents[2];
+	char contents[1];
 	char handle[21];
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN) {
@@ -742,7 +742,6 @@ static void set_status(const GDBusPropertyTable *property,
 	dbus_message_iter_get_basic(iter, &value);
 
 	contents[0] = FILLER_BYTE;
-	contents[1] = '\0';
 
 	if (snprintf(handle, sizeof(handle), "%" PRIu64, msg->handle) < 0)
 		goto fail;
@@ -1612,13 +1611,12 @@ static DBusMessage *map_update_inbox(DBusConnection *connection,
 {
 	struct map_data *map = user_data;
 	DBusMessage *reply;
-	char contents[2];
+	char contents[1];
 	struct obc_transfer *transfer;
 	GError *err = NULL;
 	struct pending_request *request;
 
 	contents[0] = FILLER_BYTE;
-	contents[1] = '\0';
 
 	transfer = obc_transfer_put("x-bt/MAP-messageUpdate", NULL, NULL,
 						contents, sizeof(contents),
@@ -1935,7 +1933,7 @@ static bool set_notification_registration(struct map_data *map, bool status)
 	struct obc_transfer *transfer;
 	GError *err = NULL;
 	GObexApparam *apparam;
-	char contents[2];
+	char contents[1];
 	const char *address;
 
 	address = obc_session_get_destination(map->session);
@@ -1951,7 +1949,6 @@ static bool set_notification_registration(struct map_data *map, bool status)
 	}
 
 	contents[0] = FILLER_BYTE;
-	contents[1] = '\0';
 
 	transfer = obc_transfer_put("x-bt/MAP-NotificationRegistration", NULL,
 					NULL, contents, sizeof(contents), &err);
-- 
1.8.3.1


  reply	other threads:[~2013-10-09 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 11:11 [PATCH BlueZ 1/7] core/profile: Fix MNS record version Luiz Augusto von Dentz
2013-10-09 11:11 ` Luiz Augusto von Dentz [this message]
2013-10-09 11:11 ` [PATCH BlueZ 3/7] obexd/MAP: Fix parsing message handles as decimal numbers Luiz Augusto von Dentz
2013-10-09 11:11 ` [PATCH BlueZ 4/7] lib/sdp: Replace VIDEO_CONF_SVCLASS_ID with AV_REMOTE_CONTROLLER_SVCLASS_ID Luiz Augusto von Dentz
2013-10-09 11:11 ` [PATCH BlueZ 5/7] profiles/AVRCP: Add AV Remote Controller service class id to CT Luiz Augusto von Dentz
2013-10-09 11:11 ` [PATCH BlueZ 6/7] tools/sdptool: Fix parsing for service class 0x110f Luiz Augusto von Dentz
2013-10-09 11:11 ` [PATCH BlueZ 7/7] tools/hcidump: " Luiz Augusto von Dentz
2013-10-09 15:42 ` [PATCH BlueZ 1/7] core/profile: Fix MNS record version Johan Hedberg

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=1381317105-10729-2-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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