forked from enlightenment/efl
eina/convert: init endptr in failure case of eina_convert_strtod_c
Summary: there is not any way to determine that this function has failed other than to check this pointer, so ensure that it always has a value which is meaningful in failure cases Reviewers: cedric Reviewed By: cedric Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10445
This commit is contained in:
parent
9ea26fd88f
commit
c81e4d5080
|
@ -476,6 +476,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr)
|
|||
unsigned long long integer_part;
|
||||
int minus;
|
||||
|
||||
if (endptr) *endptr = (char*)nptr;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(nptr, 0.0);
|
||||
|
||||
a = iter = nptr;
|
||||
|
|
|
@ -337,9 +337,9 @@ EAPI Eina_Bool eina_convert_atofp(const char *src,
|
|||
* @brief Converts a string to a floating point number.
|
||||
*
|
||||
* @param[in] nptr a string to convert. It shouldn't be NULL.
|
||||
* @param[out] endptr If endptr is not NULL, a pointer to the character after the last
|
||||
* @param[out] endptr If @p endptr is not NULL, a pointer to the character after the last
|
||||
* character used in the conversion is stored in the location referenced
|
||||
* by endptr.
|
||||
* by endptr. If @p nptr is NULL, this will also be set to NULL.
|
||||
* @return a double type floating point number.
|
||||
*
|
||||
* This function returns converted floating point number with locale-independency.
|
||||
|
|
Loading…
Reference in New Issue