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). */
| 1443 | * Returns new position in buffer. */ |
| 1444 | /* Sanitize expression string for JSON (in-place). */ |
| 1445 | static 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. */ |
| 1462 | static int format_call_arg(char *buf, size_t bufsize, const CBMCallArg *a, const char *expr) { |