| 20 | } |
| 21 | |
| 22 | bool json_escape_needed(const char *str, size_t len) |
| 23 | { |
| 24 | size_t i; |
| 25 | for (i = 0; i < len; i++) { |
| 26 | if ((unsigned)str[i] < ' ' |
| 27 | || str[i] == 127 |
| 28 | || str[i] == '"' |
| 29 | || str[i] == '\\') |
| 30 | return true; |
| 31 | } |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | static struct json_escape *escape(const tal_t *ctx, |
| 36 | const char *str TAKES, |
no outgoing calls
no test coverage detected