Re: [PATCH 10/20] sha1_name: convert struct disambiguate_state to object_id

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

 



On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson
<sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> @@ -332,7 +332,7 @@ static int init_object_disambiguation(const char *name, int len,
>                 ds->hex_pfx[i] = c;
>                 if (!(i & 1))
>                         val <<= 4;
> -               ds->bin_pfx[i >> 1] |= val;
> +               ds->bin_pfx.hash[i >> 1] |= val;

The indexing makes me a bit nervous, especially since diff context
here is too narrow to see. It would be nice if this code (at the
beginning of init_object_disambiguation) is converted here too

        if (len < MINIMUM_ABBREV || len > GIT_SHA1_HEXSZ)
                return -1;
-- 
Duy




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