MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / strbuf_append_fmt

Function strbuf_append_fmt

deps/lua/src/strbuf.c:202–217  ·  view source on GitHub ↗

strbuf_append_fmt() should only be used when an upper bound * is known for the output string. */

Source from the content-addressed store, hash-verified

200/* strbuf_append_fmt() should only be used when an upper bound
201 * is known for the output string. */
202void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...)
203{
204 va_list arg;
205 int fmt_len;
206
207 strbuf_ensure_empty_length(s, len);
208
209 va_start(arg, fmt);
210 fmt_len = vsnprintf(s->buf + s->length, len, fmt, arg);
211 va_end(arg);
212
213 if (fmt_len < 0)
214 die("BUG: Unable to convert number"); /* This should never happen.. */
215
216 s->length += fmt_len;
217}
218
219/* strbuf_append_fmt_retry() can be used when the there is no known
220 * upper bound for the output string. */

Callers

nothing calls this directly

Calls 2

dieFunction · 0.85

Tested by

no test coverage detected