# Re: \[PATCH 2/2\] entry.c: convert write\_entry to use strbuf

- From: Duy Nguyen \<hidden\>
- Date: 2016-06-15 22:59:04 
- List: git
- Page: https://ratatoskr.run/git/2016/06/7615409
- Thread: https://ratatoskr.run/git/2016/06/7615383/t.md

```text
On Fri, Oct 25, 2013 at 2:49 AM, Junio C Hamano [ref] wrote:
> Duy Nguyen [ref] writes:
>
>> On Thu, Oct 24, 2013 at 12:52 AM, Junio C Hamano [ref] wrote:
>>> Nguyễn Thái Ngọc Duy [ref] 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

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
```
