mirror of
https://github.com/rafagafe/tiny-json.git
synced 2025-03-12 19:25:30 +00:00
Remove atoll and atof to avoid cert-c violations
This commit is contained in:
parent
6eb4a6c072
commit
e27abb714a
@ -140,14 +140,14 @@ static inline bool json_getBoolean( json_t const* property ) {
|
|||||||
* @param property A valid handler of a json object. Its type must be JSON_INTEGER.
|
* @param property A valid handler of a json object. Its type must be JSON_INTEGER.
|
||||||
* @return The value stdint. */
|
* @return The value stdint. */
|
||||||
static inline int64_t json_getInteger( json_t const* property ) {
|
static inline int64_t json_getInteger( json_t const* property ) {
|
||||||
return atoll( property->u.value );
|
return strtoll( property->u.value,(char**)NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the value of a json real property.
|
/** Get the value of a json real property.
|
||||||
* @param property A valid handler of a json object. Its type must be JSON_REAL.
|
* @param property A valid handler of a json object. Its type must be JSON_REAL.
|
||||||
* @return The value. */
|
* @return The value. */
|
||||||
static inline double json_getReal( json_t const* property ) {
|
static inline double json_getReal( json_t const* property ) {
|
||||||
return atof( property->u.value );
|
return strtod( property->u.value,(char**)NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user