* [PATCH] Fix endian conversion for appparams in pbap client
@ 2011-05-08 18:00 Bartosz Szatkowski
2011-05-14 23:30 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Szatkowski @ 2011-05-08 18:00 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Bartosz Szatkowski
---
client/pbap.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/client/pbap.c b/client/pbap.c
index 837419c..dee85c8 100644
--- a/client/pbap.c
+++ b/client/pbap.c
@@ -312,6 +312,7 @@ static void read_return_apparam(struct session_data *session,
if (hdr->len == PHONEBOOKSIZE_LEN) {
guint16 val;
memcpy(&val, hdr->val, sizeof(val));
+ val = get_be16(&val);
*phone_book_size = val;
}
break;
--
1.7.5.rc3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Fix endian conversion for appparams in pbap client
2011-05-08 18:00 [PATCH] Fix endian conversion for appparams in pbap client Bartosz Szatkowski
@ 2011-05-14 23:30 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-05-14 23:30 UTC (permalink / raw)
To: Bartosz Szatkowski; +Cc: linux-bluetooth
Hi,
On Sun, May 08, 2011, Bartosz Szatkowski wrote:
> ---
> client/pbap.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/client/pbap.c b/client/pbap.c
> index 837419c..dee85c8 100644
> --- a/client/pbap.c
> +++ b/client/pbap.c
> @@ -312,6 +312,7 @@ static void read_return_apparam(struct session_data *session,
> if (hdr->len == PHONEBOOKSIZE_LEN) {
> guint16 val;
> memcpy(&val, hdr->val, sizeof(val));
> + val = get_be16(&val);
> *phone_book_size = val;
> }
> break;
Two issues with this:
1. Fix your editor settings. You're using spaces instead of tabs for
indentation.
2. Why not do *phone_book_size = get_be16(&val); directly?
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-14 23:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08 18:00 [PATCH] Fix endian conversion for appparams in pbap client Bartosz Szatkowski
2011-05-14 23:30 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox