| 1610 | } |
| 1611 | |
| 1612 | char *u64_option(struct command *cmd, const char *arg, bool check_only, u64 *i) |
| 1613 | { |
| 1614 | char *endp; |
| 1615 | u64 v; |
| 1616 | |
| 1617 | /* This is how the manpage says to do it. Yech. */ |
| 1618 | errno = 0; |
| 1619 | v = strtoul(arg, &endp, 0); |
| 1620 | if (*endp || !arg[0]) |
| 1621 | return tal_fmt(tmpctx, "'%s' is not a number", arg); |
| 1622 | if (errno) |
| 1623 | return tal_fmt(tmpctx, "'%s' is out of range", arg); |
| 1624 | if (!check_only) |
| 1625 | *i = v; |
| 1626 | return NULL; |
| 1627 | } |
| 1628 | |
| 1629 | char *u32_option(struct command *cmd, const char *arg, bool check_only, u32 *i) |
| 1630 | { |
no outgoing calls
no test coverage detected