MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / hoedown_buffer_printf

Function hoedown_buffer_printf

libraries/hoedown/src/buffer.c:237–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void
238hoedown_buffer_printf(hoedown_buffer *buf, const char *fmt, ...)
239{
240 va_list ap;
241 int n;
242
243 assert(buf && buf->unit);
244
245 if (buf->size >= buf->asize)
246 hoedown_buffer_grow(buf, buf->size + 1);
247
248 va_start(ap, fmt);
249 n = vsnprintf((char *)buf->data + buf->size, buf->asize - buf->size, fmt, ap);
250 va_end(ap);
251
252 if (n < 0) {
253#ifndef _MSC_VER
254 return;
255#else
256 va_start(ap, fmt);
257 n = _vscprintf(fmt, ap);
258 va_end(ap);
259#endif
260 }
261
262 if ((size_t)n >= buf->asize - buf->size) {
263 hoedown_buffer_grow(buf, buf->size + n + 1);
264
265 va_start(ap, fmt);
266 n = vsnprintf((char *)buf->data + buf->size, buf->asize - buf->size, fmt, ap);
267 va_end(ap);
268 }
269
270 if (n < 0)
271 return;
272
273 buf->size += n;
274}
275
276void hoedown_buffer_put_utf8(hoedown_buffer *buf, unsigned int c) {
277 unsigned char unichar[4];

Callers 4

rndr_headerFunction · 0.85
rndr_footnote_defFunction · 0.85
rndr_footnote_refFunction · 0.85
toc_headerFunction · 0.85

Calls 1

hoedown_buffer_growFunction · 0.85

Tested by

no test coverage detected