| 50 | } |
| 51 | |
| 52 | bool json_tok_endswith(const char *buffer, const jsmntok_t *tok, |
| 53 | const char *suffix) |
| 54 | { |
| 55 | if (tok->type != JSMN_STRING) |
| 56 | return false; |
| 57 | if (tok->end - tok->start < strlen(suffix)) |
| 58 | return false; |
| 59 | return memcmp(buffer + tok->end - strlen(suffix), |
| 60 | suffix, strlen(suffix)) == 0; |
| 61 | } |
| 62 | |
| 63 | char *json_strdup(const tal_t *ctx, const char *buffer, const jsmntok_t *tok) |
| 64 | { |
no outgoing calls
no test coverage detected