MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_escape_needed

Function json_escape_needed

ccan/ccan/json_escape/json_escape.c:22–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool 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
35static struct json_escape *escape(const tal_t *ctx,
36 const char *str TAKES,

Callers 5

check_fieldnameFunction · 0.85
json_out_addvFunction · 0.85
json_out_addstrFunction · 0.85
escapeFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected