Re: [PATCH 2/2] entry.c: convert write_entry to use strbuf

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

 



On Fri, Oct 25, 2013 at 2:49 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Duy Nguyen <pclouds@xxxxxxxxx> writes:
>
>> On Thu, Oct 24, 2013 at 12:52 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>> Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes:
>>>
>>>> The strcpy call in open_output_fd() implies that the output buffer
>>>> must be at least 25 chars long.
>>>
>>> Hmph, where does that 25 come from?
>>>
>>> [snipped]
>>
>> Much better. Thanks.
>
> So where does that 25 come from?
>
> We strcpy ".merge_link_XXXXXX" or ".merge_file_XXXXXX" into path[]
> and run mkstemp() on it, and these templates are 18 bytes long, so I
> am puzzled.
>
> Is 25 "just a small random number that is surely longer than these
> templates--did not bother to count how long the templates are"?

Yes. I was too lazy to subtract precisely the column number from
between the quotes, so I just made sure the number is large enough to
cover the columns..

> That's fine by me; I am just trying to make sure I am not missing
> anything that turns these templates into a longer filename.
-- 
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]