| 47 | } |
| 48 | |
| 49 | static char *opt_set_u64(const char *arg, u64 *u) |
| 50 | { |
| 51 | char *endp; |
| 52 | unsigned long long l; |
| 53 | |
| 54 | assert(arg != NULL); |
| 55 | |
| 56 | /* This is how the manpage says to do it. Yech. */ |
| 57 | errno = 0; |
| 58 | l = strtoull(arg, &endp, 0); |
| 59 | if (*endp || !arg[0]) |
| 60 | return tal_fmt(tmpctx, "'%s' is not a number", arg); |
| 61 | *u = l; |
| 62 | if (errno || *u != l) |
| 63 | return tal_fmt(tmpctx, "'%s' is out of range", arg); |
| 64 | return NULL; |
| 65 | } |
| 66 | |
| 67 | static char *opt_set_u64_dynamic(const char *arg, u64 *u) |
| 68 | { |
no outgoing calls
no test coverage detected