Re: [PATCH] log-tree: fix patch filename computation in "git format-patch"

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

 



On Thu, Mar 26, 2009 at 9:15 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Shouldn't it be just:
>
>        size_t max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len;
>        if (max_len < buf->len)
>                strbuf_setlen(buf, max_len);
>        strbuf_addstr(buf, suffix);

Yes, this is good.

>
> The caller must make sure that suffix_len is sufficiently shorter than
> FORMAT_PATCH_NAME_MAX; I do not know if the current code does that,
> though.
>

The original code never did this. What should happen in this case?

I am away on travel this week, so I won't be able to update this until Monday.

Thanks,
Stephen
--
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]

  Powered by Linux