| 447 | } |
| 448 | |
| 449 | struct command_result *param_label(struct command *cmd, const char *name, |
| 450 | const char * buffer, const jsmntok_t *tok, |
| 451 | struct json_escape **label) |
| 452 | { |
| 453 | /* We accept both strings and number literals here. */ |
| 454 | *label = json_escape_string_(cmd, buffer + tok->start, tok->end - tok->start); |
| 455 | if (*label && (tok->type == JSMN_STRING || json_tok_is_num(buffer, tok))) |
| 456 | return NULL; |
| 457 | |
| 458 | return command_fail_badparam(cmd, name, buffer, tok, |
| 459 | "should be a string or number"); |
| 460 | } |
| 461 | |
| 462 | struct command_result *param_number(struct command *cmd, const char *name, |
| 463 | const char *buffer, const jsmntok_t *tok, |
nothing calls this directly
no test coverage detected