Convert unique_id string to u64. We only expect this to fail when we're * dealing with runes from elsewhere (i.e. param_rune) */
| 51 | /* Convert unique_id string to u64. We only expect this to fail when we're |
| 52 | * dealing with runes from elsewhere (i.e. param_rune) */ |
| 53 | static bool unique_id_num(const struct rune *rune, u64 *num) |
| 54 | { |
| 55 | unsigned long long l; |
| 56 | char *end; |
| 57 | |
| 58 | if (!rune->unique_id) |
| 59 | return false; |
| 60 | l = strtoull(rune->unique_id, &end, 0); |
| 61 | if (*end) |
| 62 | return false; |
| 63 | |
| 64 | /* sqlite3 only does signed 64 bits, so don't exceed 63 bits. */ |
| 65 | if (l > INT64_MAX) |
| 66 | return false; |
| 67 | |
| 68 | *num = l; |
| 69 | return true; |
| 70 | } |
| 71 | |
| 72 | u64 rune_unique_id(const struct rune *rune) |
| 73 | { |
no outgoing calls
no test coverage detected