| 437 | } |
| 438 | |
| 439 | struct 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 | |
| 456 | struct command_result *param_string(struct command *cmd, const char *name, |
| 457 | const char * buffer, const jsmntok_t *tok, |
no test coverage detected