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

Function json_escaped_len

src/git/git_context.c:357–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357static int json_escaped_len(const char *src) {
358 if (!src) {
359 return 0;
360 }
361 int len = 0;
362 for (int i = 0; src[i]; i++) {
363 unsigned char c = (unsigned char)src[i];
364 if (c == '"' || c == '\\' || c == '\n' || c == '\r' || c == '\t') {
365 len += 2;
366 } else if (c < 0x20) {
367 len += 6; /* \u00XX */
368 } else {
369 len++;
370 }
371 }
372 return len;
373}
374
375static bool json_append_bool(char *buf, int buf_size, int *off, const char *name, bool value,
376 bool comma) {

Callers 1

json_append_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected