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

Function strbuf_splice

strbuf.c:244–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244void strbuf_splice(struct strbuf *sb, size_t pos, size_t len,
245 const void *data, size_t dlen)
246{
247 if (unsigned_add_overflows(pos, len))
248 die("you want to use way too much memory");
249 if (pos > sb->len)
250 die("`pos' is too far after the end of the buffer");
251 if (pos + len > sb->len)
252 die("`pos + len' is too far after the end of the buffer");
253
254 if (dlen >= len)
255 strbuf_grow(sb, dlen - len);
256 memmove(sb->buf + pos + dlen,
257 sb->buf + pos + len,
258 sb->len - pos - len);
259 memcpy(sb->buf + pos, data, dlen);
260 strbuf_setlen(sb, sb->len + dlen - len);
261}
262
263void strbuf_insert(struct strbuf *sb, size_t pos, const void *data, size_t len)
264{

Callers 15

replace_dirFunction · 0.85
adjust_git_pathFunction · 0.85
packet_read_with_statusFunction · 0.85
rewrite_ident_lineFunction · 0.85
update_squash_messagesFunction · 0.85
lookup_labelFunction · 0.85
append_signoffFunction · 0.85
replace_encoding_headerFunction · 0.85
strbuf_insertFunction · 0.85
strbuf_removeFunction · 0.85

Calls 3

strbuf_growFunction · 0.85
strbuf_setlenFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected