| 86 | } |
| 87 | |
| 88 | bool json_to_int(const char *buffer, const jsmntok_t *tok, int *num) |
| 89 | { |
| 90 | s64 tmp; |
| 91 | |
| 92 | if (!json_to_s64(buffer, tok, &tmp)) |
| 93 | return false; |
| 94 | *num = tmp; |
| 95 | |
| 96 | /* Just in case it doesn't fit. */ |
| 97 | if (*num != tmp) |
| 98 | return false; |
| 99 | |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | bool json_to_zero_or_one(const char *buffer, const jsmntok_t *tok, int *num) |
| 104 | { |