2011-06-02 12:54:32

by Lukasz Pawlik

[permalink] [raw]
Subject: [PATCH] Fix type in conditional expression

Function media_endpoint_create returns pointer to structure. In
conditional expression it is safer to compare returned value with NULL
and not with gboolean as it is done in register_endpoint function.
---
audio/media.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/media.c b/audio/media.c
index 0efb0a8..0eb712a 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -365,7 +365,7 @@ static DBusMessage *register_endpoint(DBusConnection *conn, DBusMessage *msg,
return btd_error_invalid_args(msg);

if (media_endpoint_create(adapter, sender, path, uuid, delay_reporting,
- codec, capabilities, size, &err) == FALSE) {
+ codec, capabilities, size, &err) == NULL) {
if (err == -EPROTONOSUPPORT)
return btd_error_not_supported(msg);
else
--
1.7.4.1



2011-06-08 01:01:37

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Fix type in conditional expression

Hi Lukasz,

On Thu, Jun 02, 2011, Lukasz Pawlik wrote:
> Function media_endpoint_create returns pointer to structure. In
> conditional expression it is safer to compare returned value with NULL
> and not with gboolean as it is done in register_endpoint function.
> ---
> audio/media.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan