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

Function append_fmt_checked

src/git/git_context.c:340–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340static bool append_fmt_checked(char *buf, int buf_size, int *off, const char *fmt, ...) {
341 if (!buf || !off || buf_size <= 0 || *off < 0 || *off >= buf_size) {
342 return false;
343 }
344
345 va_list ap;
346 va_start(ap, fmt);
347 int n = vsnprintf(buf + *off, (size_t)(buf_size - *off), fmt, ap);
348 va_end(ap);
349 if (n < 0 || n >= buf_size - *off) {
350 buf[buf_size - 1] = '\0';
351 return false;
352 }
353 *off += n;
354 return true;
355}
356
357static int json_escaped_len(const char *src) {
358 if (!src) {

Callers 3

json_append_boolFunction · 0.85
json_append_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected