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

Function json_to_double

common/json_parse_simple.c:116–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

process_json_objFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected