MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / dbuf_write

Function dbuf_write

tinyemu/cutils.c:92–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void dbuf_write(DynBuf *s, size_t offset, const uint8_t *data, size_t len)
93{
94 size_t end, new_size;
95 new_size = end = offset + len;
96 if (new_size > s->allocated_size) {
97 new_size = max_int(new_size, s->allocated_size * 3 / 2);
98 s->buf = realloc(s->buf, new_size);
99 s->allocated_size = new_size;
100 }
101 memcpy(s->buf + offset, data, len);
102 if (end > s->size)
103 s->size = end;
104}
105
106void dbuf_putc(DynBuf *s, uint8_t c)
107{

Callers 3

dbuf_putcFunction · 0.85
dbuf_putstrFunction · 0.85
fs_wget_write_cbFunction · 0.85

Calls 1

max_intFunction · 0.85

Tested by

no test coverage detected