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

Function append_fmt_checked

src/git/git_context.c:378–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378static bool append_fmt_checked(char *buf, int buf_size, int *off, const char *fmt, ...) {
379 if (!buf || !off || buf_size <= 0 || *off < 0 || *off >= buf_size) {
380 return false;
381 }
382
383 va_list ap;
384 va_start(ap, fmt);
385 int n = vsnprintf(buf + *off, (size_t)(buf_size - *off), fmt, ap);
386 va_end(ap);
387 if (n < 0 || n >= buf_size - *off) {
388 buf[buf_size - 1] = '\0';
389 return false;
390 }
391 *off += n;
392 return true;
393}
394
395static int json_escaped_len(const char *src) {
396 if (!src) {

Callers 3

json_append_boolFunction · 0.85
json_append_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected