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

Function json_escape_string_

ccan/ccan/json_escape/json_escape.c:6–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <ccan/tal/str/str.h>
5
6struct json_escape *json_escape_string_(const tal_t *ctx,
7 const void *bytes, size_t len)
8{
9 struct json_escape *esc;
10
11 esc = (void *)tal_arr_label(ctx, char, len + 1,
12 TAL_LABEL(struct json_escape, ""));
13 memcpy(esc->s, bytes, len);
14 esc->s[len] = '\0';
15 return esc;
16}
17
18bool json_escape_eq(const struct json_escape *a, const struct json_escape *b)
19{

Callers 3

json_escape_dupFunction · 0.85
param_labelFunction · 0.85
db_col_json_escapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected