[Replicant] [PATCH 4/6] client: Fix warning about array comparison to a null pointer

Joonas Kylmälä joonas.kylmala at iki.fi
Sun Jun 2 17:12:35 UTC 2019


Hi,

Reviewed-by: Joonas Kylmälä <joonas.kylmala at iki.fi>

Joonas

Denis 'GNUtoo' Carikli:
> Without that fix we have:
>   client.c:32:6: error: comparison of array
>   'ril_clients' equal to a null pointer is always
>   false [-Werror,-Wtautological-pointer-compare]
>         if (ril_clients == NULL || ril_clients_count == 0)
>             ^~~~~~~~~~~    ~~~~
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
> ---
>  client.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/client.c b/client.c
> index ab66a40..8958fd4 100644
> --- a/client.c
> +++ b/client.c
> @@ -29,7 +29,7 @@ struct ril_client *ril_client_find_id(int id)
>  {
>  	unsigned int i;
>  
> -	if (ril_clients == NULL || ril_clients_count == 0)
> +	if (ril_clients_count == 0)
>  		return NULL;
>  
>  	for (i = 0; i < ril_clients_count; i++) {
> 


More information about the Replicant mailing list