Re: [PATCH 4/4] Better filtering input string contain bdaddr

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

 



On Mon, Dec 27, 2010 at 7:02 AM, Michal Labedzki
<michal.labedzki@xxxxxxxxx> wrote:
> +               if (((*ptr < 'A' || *ptr > 'F') &&
> +                       (*ptr < 'a' || *ptr > 'f') &&
> +                       (*ptr < '0' || *ptr > '9')) ||
> +                       ( (ptr - str) == 2 && *ptr != ':')) {
> +                       bt_free(ba);
> +                       goto err_bdaddr;
> +               }

The logic above seems wrong. Make sure you are not mixing || and &&.

> +
> +               ++i;
> +               ++ptr;

I think the usual coding style in bluez uses post-increment in these
cases (e.g. i++).

Regards,
-- 
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
--
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