Merge pull request #12 from ibortolazzi/remove-atoll

Remove atoll and atof to avoid cert-c violations
This commit is contained in:
Rafa García 2021-04-21 01:12:59 +02:00 committed by GitHub
commit 3d91fc49dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.
* @return The value stdint. */
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.
* @param property A valid handler of a json object. Its type must be JSON_REAL.
* @return The value. */
static inline double json_getReal( json_t const* property ) {
return atof( property->u.value );
return strtod( property->u.value,(char**)NULL );
}