| 412 | } |
| 413 | |
| 414 | struct command_result *param_escaped_string(struct command *cmd, |
| 415 | const char *name, |
| 416 | const char * buffer, |
| 417 | const jsmntok_t *tok, |
| 418 | const char **str) |
| 419 | { |
| 420 | if (tok->type == JSMN_STRING) { |
| 421 | struct json_escape *esc; |
| 422 | /* jsmn always gives us ~ well-formed strings. */ |
| 423 | esc = json_escape_string_(cmd, buffer + tok->start, |
| 424 | tok->end - tok->start); |
| 425 | *str = json_escape_unescape(cmd, esc); |
| 426 | if (*str) |
| 427 | return NULL; |
| 428 | } |
| 429 | return command_fail_badparam(cmd, name, buffer, tok, |
| 430 | "should be a string (without \\u)"); |
| 431 | } |
| 432 | |
| 433 | struct command_result *param_string(struct command *cmd, const char *name, |
| 434 | const char * buffer, const jsmntok_t *tok, |
nothing calls this directly
no test coverage detected