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