| 1143 | } |
| 1144 | |
| 1145 | char *u16_option(const char *arg, u16 *i) |
| 1146 | { |
| 1147 | char *endp; |
| 1148 | u64 n; |
| 1149 | |
| 1150 | errno = 0; |
| 1151 | n = strtoul(arg, &endp, 0); |
| 1152 | if (*endp || !arg[0]) |
| 1153 | return tal_fmt(NULL, "'%s' is not a number", arg); |
| 1154 | if (errno) |
| 1155 | return tal_fmt(NULL, "'%s' is out of range", arg); |
| 1156 | |
| 1157 | *i = n; |
| 1158 | if (*i != n) |
| 1159 | return tal_fmt(NULL, "'%s' is too large (overflow)", arg); |
| 1160 | |
| 1161 | return NULL; |
| 1162 | } |
| 1163 | |
| 1164 | char *bool_option(const char *arg, bool *i) |
| 1165 | { |
no outgoing calls
no test coverage detected