MCPcopy Index your code
hub / github.com/git/git / strbuf_vaddf

Function strbuf_vaddf

strbuf.c:417–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
418{
419 int len;
420 va_list cp;
421
422 if (!strbuf_avail(sb))
423 strbuf_grow(sb, 64);
424 va_copy(cp, ap);
425 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, cp);
426 va_end(cp);
427 if (len < 0)
428 die(_("unable to format message: %s"), fmt);
429 if (len > strbuf_avail(sb)) {
430 strbuf_grow(sb, len);
431 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
432 if (len > strbuf_avail(sb))
433 BUG("your vsnprintf is broken (insatiable)");
434 }
435 strbuf_setlen(sb, sb->len + len);
436}
437
438int strbuf_expand_step(struct strbuf *sb, const char **formatp)
439{

Callers 15

path_msgFunction · 0.85
repo_git_pathvFunction · 0.85
mkpathdupFunction · 0.85
mkpathFunction · 0.85
do_worktree_pathFunction · 0.85
do_submodule_pathFunction · 0.85
repo_common_pathvFunction · 0.85
strbuf_addf_retFunction · 0.85
send_err_and_dieFunction · 0.85
write_fileFunction · 0.85
format_packetFunction · 0.85
strbuf_addf_gentlyFunction · 0.85

Calls 4

strbuf_availFunction · 0.85
strbuf_growFunction · 0.85
strbuf_setlenFunction · 0.85
dieFunction · 0.70

Tested by 1

showFunction · 0.68