MCPcopy Create free account
hub / github.com/ElementsProject/lightning / opt_set_s32

Function opt_set_s32

lightningd/options.c:96–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static 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
114char *opt_set_autobool_arg(const char *arg, enum opt_autobool *b)
115{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected