From e27abb714aea49a9bc3f8de191cc8a685493cc66 Mon Sep 17 00:00:00 2001 From: Ignacio Bortolazzi Date: Tue, 2 Mar 2021 19:37:16 +0100 Subject: [PATCH] Remove atoll and atof to avoid cert-c violations --- tiny-json.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiny-json.h b/tiny-json.h index 2ad97ec..2b527e7 100644 --- a/tiny-json.h +++ b/tiny-json.h @@ -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 ); }