MCPcopy Create free account
hub / github.com/git/git / strbuf_fread

Function strbuf_fread

strbuf.c:519–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519size_t strbuf_fread(struct strbuf *sb, size_t size, FILE *f)
520{
521 size_t res;
522 size_t oldalloc = sb->alloc;
523
524 strbuf_grow(sb, size);
525 res = fread(sb->buf + sb->len, 1, size, f);
526 if (res > 0)
527 strbuf_setlen(sb, sb->len + res);
528 else if (oldalloc == 0)
529 strbuf_release(sb);
530 return res;
531}
532
533ssize_t strbuf_read(struct strbuf *sb, int fd, size_t hint)
534{

Callers 5

stat_parent_pidFunction · 0.85
cmd__path_walkFunction · 0.85
stgit_patch_to_mailFunction · 0.85
hg_patch_to_mailFunction · 0.85
parse_dataFunction · 0.85

Calls 3

strbuf_growFunction · 0.85
strbuf_setlenFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by 1

cmd__path_walkFunction · 0.68