MCPcopy Create free account
hub / github.com/commonmark/cmark / cmark_strbuf_set

Function cmark_strbuf_set

src/buffer.c:78–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void cmark_strbuf_set(cmark_strbuf *buf, const unsigned char *data,
79 bufsize_t len) {
80 if (len <= 0 || data == NULL) {
81 cmark_strbuf_clear(buf);
82 } else {
83 if (data != buf->ptr) {
84 if (len >= buf->asize)
85 cmark_strbuf_grow(buf, len);
86 memmove(buf->ptr, data, len);
87 }
88 buf->size = len;
89 buf->ptr[buf->size] = '\0';
90 }
91}
92
93void cmark_strbuf_putc(cmark_strbuf *buf, int c) {
94 S_strbuf_grow_by(buf, 1);

Callers 1

handle_backticksFunction · 0.85

Calls 2

cmark_strbuf_clearFunction · 0.85
cmark_strbuf_growFunction · 0.85

Tested by

no test coverage detected