| 94 | } |
| 95 | |
| 96 | static char *opt_set_s32(const char *arg, s32 *u) |
| 97 | { |
| 98 | char *endp; |
| 99 | long l; |
| 100 | |
| 101 | assert(arg != NULL); |
| 102 | |
| 103 | /* This is how the manpage says to do it. Yech. */ |
| 104 | errno = 0; |
| 105 | l = strtol(arg, &endp, 0); |
| 106 | if (*endp || !arg[0]) |
| 107 | return tal_fmt(tmpctx, "'%s' is not a number", arg); |
| 108 | *u = l; |
| 109 | if (errno || *u != l) |
| 110 | return tal_fmt(tmpctx, "'%s' is out of range", arg); |
| 111 | return NULL; |
| 112 | } |
| 113 | |
| 114 | char *opt_set_autobool_arg(const char *arg, enum opt_autobool *b) |
| 115 | { |
nothing calls this directly
no outgoing calls
no test coverage detected