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

Function json_to_double

common/json_parse_simple.c:110–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110bool json_to_double(const char *buffer, const jsmntok_t *tok, double *num)
111{
112 char *end;
113
114 errno = 0;
115 *num = strtod(buffer + tok->start, &end);
116 if (end != buffer + tok->end)
117 return false;
118
119 /* Check for overflow/underflow */
120 if (errno == ERANGE)
121 return false;
122
123 return true;
124}
125
126bool json_to_u32(const char *buffer, const jsmntok_t *tok, u32 *num)
127{

Callers 1

process_json_objFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected