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