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

Function u16_option

plugins/libplugin.c:1145–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143}
1144
1145char *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
1164char *bool_option(const char *arg, bool *i)
1165{

Calls

no outgoing calls

Tested by

no test coverage detected