[Pdbg] [PATCH 6/6] path: Fix clang warning -Wpointer-bool-conversion
Alistair Popple
alistair at popple.id.au
Tue Jul 2 11:46:20 AEST 2019
Thanks Amitay.
Reviewed-by: Alistair Popple <alistair at popple.id.au>
On Wednesday, 19 June 2019 1:15:50 PM AEST Amitay Isaacs wrote:
> ./../src/path.c:126:12: error: address of array 'pat->prefix' will always
> evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (!pat->prefix)
>
> Check if pat->prefix is not a null string.
>
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
> src/path.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/path.c b/src/path.c
> index e6c9d94..a80a288 100644
> --- a/src/path.c
> +++ b/src/path.c
> @@ -123,7 +123,7 @@ static bool path_pattern_parse(const char *arg, struct
> path_pattern *pat) safe_strcpy(pat->prefix, sizeof(pat->prefix), tmp);
> }
>
> - if (!pat->prefix)
> + if (!pat->prefix[0])
> return false;
>
> return true;
More information about the Pdbg
mailing list