Re: [PATCH 2/2] entry.c: convert write_entry to use strbuf
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 24, 2013, 23:47 UTC
- Message-ID
- <CACsJy8D0PiY487N-OB5KuJOvz26vyu8dtUtbxticqZVScomaDA@mail.gmail.com>
- In-Reply-To
- <xmqq8uxio3ed.fsf@gitster.dls.corp.google.com>
On Fri, Oct 25, 2013 at 2:49 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes: > >> On Thu, Oct 24, 2013 at 12:52 AM, Junio C Hamano <gitster@pobox.com> wrote: >>> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> 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.