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

Function param_escaped_string

common/json_param.c:439–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439struct command_result *param_escaped_string(struct command *cmd,
440 const char *name,
441 const char * buffer,
442 const jsmntok_t *tok,
443 const char **str)
444{
445 if (tok->type == JSMN_STRING) {
446 /* jsmn always gives us ~ well-formed strings. */
447 *str = json_escape_unescape_len(cmd, buffer + tok->start,
448 tok->end - tok->start);
449 if (*str)
450 return NULL;
451 }
452 return command_fail_badparam(cmd, name, buffer, tok,
453 "should be a string (without \\u)");
454}
455
456struct command_result *param_string(struct command *cmd, const char *name,
457 const char * buffer, const jsmntok_t *tok,

Callers 2

param_report_formatFunction · 0.85

Calls 2

json_escape_unescape_lenFunction · 0.85
command_fail_badparamFunction · 0.70

Tested by

no test coverage detected