2014-10-28 13:24:48

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] unit/hfp: Fix wrong check

From: Andrei Emeltchenko <[email protected]>

---
unit/test-hfp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/unit/test-hfp.c b/unit/test-hfp.c
index 24ea402..c11a424 100644
--- a/unit/test-hfp.c
+++ b/unit/test-hfp.c
@@ -154,8 +154,7 @@ static gboolean send_pdu(gpointer user_data)
ssize_t len;

pdu = &context->data->pdu_list[context->pdu_offset++];
-
- if (pdu && !pdu->valid)
+ if (!pdu || !pdu->valid)
return FALSE;

len = write(context->fd_server, pdu->data, pdu->size);
--
1.9.1



2014-10-30 09:30:06

by Szymon Janc

[permalink] [raw]
Subject: Re: [PATCH] unit/hfp: Fix wrong check

Hi Andrei,

On Tuesday 28 of October 2014 15:24:48 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <[email protected]>
>
> ---
> unit/test-hfp.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/unit/test-hfp.c b/unit/test-hfp.c
> index 24ea402..c11a424 100644
> --- a/unit/test-hfp.c
> +++ b/unit/test-hfp.c
> @@ -154,8 +154,7 @@ static gboolean send_pdu(gpointer user_data)
> ssize_t len;
>
> pdu = &context->data->pdu_list[context->pdu_offset++];
> -
> - if (pdu && !pdu->valid)
> + if (!pdu || !pdu->valid)
> return FALSE;
>
> len = write(context->fd_server, pdu->data, pdu->size);

Patch applied after fixing commit prefix, thanks.

--
BR
Szymon Janc