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

Function integer_compare_valid

ccan/ccan/rune/rune.c:263–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263static const char *integer_compare_valid(const tal_t *ctx,
264 const s64 *fieldval_int,
265 const struct rune_altern *alt,
266 s64 *runeval_int)
267{
268 long l;
269 char *p;
270
271 if (!fieldval_int)
272 return tal_fmt(ctx, "%s is not an integer field",
273 alt->fieldname);
274
275 errno = 0;
276 l = strtol(alt->value, &p, 10);
277 if (p == alt->value
278 || *p
279 || ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE))
280 return tal_fmt(ctx, "%s is not a valid integer", alt->value);
281
282 *runeval_int = l;
283 return NULL;
284}
285
286static int lexo_order(const char *fieldval_str,
287 size_t fieldval_strlen,

Callers 1

rune_alt_singleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected