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

Function integer_compare_valid

ccan/ccan/rune/rune.c:267–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

rune_alt_singleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected