| 1620 | } |
| 1621 | |
| 1622 | char *u64_option(struct command *cmd, const char *arg, bool check_only, u64 *i) |
| 1623 | { |
| 1624 | char *endp; |
| 1625 | u64 v; |
| 1626 | |
| 1627 | /* This is how the manpage says to do it. Yech. */ |
| 1628 | errno = 0; |
| 1629 | v = strtoul(arg, &endp, 0); |
| 1630 | if (*endp || !arg[0]) |
| 1631 | return tal_fmt(tmpctx, "'%s' is not a number", arg); |
| 1632 | if (errno) |
| 1633 | return tal_fmt(tmpctx, "'%s' is out of range", arg); |
| 1634 | if (!check_only) |
| 1635 | *i = v; |
| 1636 | return NULL; |
| 1637 | } |
| 1638 | |
| 1639 | char *u32_option(struct command *cmd, const char *arg, bool check_only, u32 *i) |
| 1640 | { |
no outgoing calls
no test coverage detected