Re: [PATCH] general style: replaces memcmp() with starts_with()

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

 



On Wed, Mar 12, 2014 at 8:44 PM, Quint Guvernator
<quintus.public@xxxxxxxxx> wrote:
> diff --git a/builtin/apply.c b/builtin/apply.c
> index a7e72d5..8f21957 100644
> --- a/builtin/apply.c
> +++ b/builtin/apply.c
> @@ -846,8 +846,8 @@ static int has_epoch_timestamp(const char *nameline)
>          * YYYY-MM-DD hh:mm:ss must be from either 1969-12-31
>          * (west of GMT) or 1970-01-01 (east of GMT)
>          */
> -       if ((zoneoffset < 0 && memcmp(timestamp, "1969-12-31", 10)) ||
> -           (0 <= zoneoffset && memcmp(timestamp, "1970-01-01", 10)))
> +       if ((zoneoffset < 0 && starts_with(timestamp, "1969-12-31")) ||
> +           (0 <= zoneoffset && starts_with(timestamp, "1970-01-01")))
>                 return 0;

It is not a plain search/replace. starts_with(..) == !memcmp(...). So
you need to negate every replacement.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]