Re: [PATCH 1/2] shared/hfp: Remove reduntant check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lukasz,

On 30 October 2014 00:16, Lukasz Rymanowski <lukasz.rymanowski@xxxxxxxxx> wrote:
> This check is not needed. Below memcmp check is sufficient
> ---
>  src/shared/hfp.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/shared/hfp.c b/src/shared/hfp.c
> index 22e9622..f5a812d 100644
> --- a/src/shared/hfp.c
> +++ b/src/shared/hfp.c
> @@ -135,9 +135,6 @@ static bool match_handler_prefix(const void *a, const void *b)
>         const struct cmd_handler *handler = a;
>         const char *prefix = b;
>
> -       if (strlen(handler->prefix) != strlen(prefix))
> -               return false;
> -
>         if (memcmp(handler->prefix, prefix, strlen(prefix)))
>                 return false;
it is incorrect in case prefix is sub-string of handler->prefix
>
> --
> 1.8.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

BR
Marcin
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux