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

Function sanitize_expr

src/pipeline/pass_parallel.c:1445–1459  ·  view source on GitHub ↗

Append arg data as JSON to edge properties: ,"args":[{"i":0,"e":"x","v":"val"},...] * Returns new position in buffer. */ Sanitize expression string for JSON (in-place). */

Source from the content-addressed store, hash-verified

1443 * Returns new position in buffer. */
1444/* Sanitize expression string for JSON (in-place). */
1445static void sanitize_expr(char *expr_buf, const char *expr) {
1446 if (expr) {
1447 snprintf(expr_buf, 128, "%.*s", 120, expr);
1448 for (char *p = expr_buf; *p; p++) {
1449 if (*p == '"') {
1450 *p = '\'';
1451 }
1452 if (*p == '\n' || *p == '\r') {
1453 *p = ' ';
1454 }
1455 }
1456 } else {
1457 expr_buf[0] = '\0';
1458 }
1459}
1460
1461/* Format one call arg as JSON. Returns snprintf result. */
1462static int format_call_arg(char *buf, size_t bufsize, const CBMCallArg *a, const char *expr) {

Callers 1

append_args_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected