Re: [PATCH v2] C: use skip-prefix to avoid hardcoded string length

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

 



On 1/30/20 8:35 PM, Junio C Hamano wrote:
> We often skip an optional prefix in a string with a hardcoded
> constant, e.g.
>
>       if (starts_with(string, "prefix"))
>               string += 6;
>
> which is less error prone when written
>
>       skip_prefix(string, "prefix", &string);

Should the subject line say "skip_prefix" with an underscore instead of
"skip-prefix" with a dash?



[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]

  Powered by Linux