| 71 | } |
| 72 | |
| 73 | bool json_to_u16(const char *buffer, const jsmntok_t *tok, |
| 74 | short unsigned int *num) |
| 75 | { |
| 76 | uint64_t u64; |
| 77 | |
| 78 | if (!json_to_u64(buffer, tok, &u64)) |
| 79 | return false; |
| 80 | *num = u64; |
| 81 | |
| 82 | /* Just in case it doesn't fit. */ |
| 83 | if (*num != u64) |
| 84 | return false; |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | bool json_to_int(const char *buffer, const jsmntok_t *tok, int *num) |
| 89 | { |
no test coverage detected