| 76 | } |
| 77 | |
| 78 | static char *opt_set_u32(const char *arg, u32 *u) |
| 79 | { |
| 80 | char *endp; |
| 81 | unsigned long l; |
| 82 | |
| 83 | assert(arg != NULL); |
| 84 | |
| 85 | /* This is how the manpage says to do it. Yech. */ |
| 86 | errno = 0; |
| 87 | l = strtoul(arg, &endp, 0); |
| 88 | if (*endp || !arg[0]) |
| 89 | return tal_fmt(tmpctx, "'%s' is not a number", arg); |
| 90 | *u = l; |
| 91 | if (errno || *u != l) |
| 92 | return tal_fmt(tmpctx, "'%s' is out of range", arg); |
| 93 | return NULL; |
| 94 | } |
| 95 | |
| 96 | static char *opt_set_s32(const char *arg, s32 *u) |
| 97 | { |
no outgoing calls
no test coverage detected