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

Function json_escaped_len

src/git/git_context.c:395–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395static int json_escaped_len(const char *src) {
396 if (!src) {
397 return 0;
398 }
399 int len = 0;
400 for (int i = 0; src[i]; i++) {
401 unsigned char c = (unsigned char)src[i];
402 if (c == '"' || c == '\\' || c == '\n' || c == '\r' || c == '\t') {
403 len += 2;
404 } else if (c < 0x20) {
405 len += 6; /* \u00XX */
406 } else {
407 len++;
408 }
409 }
410 return len;
411}
412
413static bool json_append_bool(char *buf, int buf_size, int *off, const char *name, bool value,
414 bool comma) {

Callers 1

json_append_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected