MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / append_fmt_checked

Function append_fmt_checked

src/git/git_context.c:330–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330static bool append_fmt_checked(char *buf, int buf_size, int *off, const char *fmt, ...) {
331 if (!buf || !off || buf_size <= 0 || *off < 0 || *off >= buf_size) {
332 return false;
333 }
334
335 va_list ap;
336 va_start(ap, fmt);
337 int n = vsnprintf(buf + *off, (size_t)(buf_size - *off), fmt, ap);
338 va_end(ap);
339 if (n < 0 || n >= buf_size - *off) {
340 buf[buf_size - 1] = '\0';
341 return false;
342 }
343 *off += n;
344 return true;
345}
346
347static int json_escaped_len(const char *src) {
348 if (!src) {

Callers 3

json_append_boolFunction · 0.85
json_append_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected