From 831f4a98c660aaff695b906db416cc3df4cccb5c Mon Sep 17 00:00:00 2001 From: Upasana Date: Fri, 11 Jul 2014 22:47:26 +0530 Subject: [PATCH] *endptr should be set in rrd_strtoding, not endptr so that value is reflected in the callee function as well --- src/rrd_strtod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rrd_strtod.c b/src/rrd_strtod.c index 9c5fe0ea..0c408274 100644 --- a/src/rrd_strtod.c +++ b/src/rrd_strtod.c @@ -45,13 +45,13 @@ /* returns 2 on success */ /* i.e. if the whole string has been converted to a double successfully */ unsigned int rrd_strtoding -(const char * str, char ** endptr, double * dbl, char * error) { - char * local_endptr; +(const char *str, char **endptr, double *dbl, char *error) { + char *local_endptr = (char *)str; *dbl = rrd_strtod( str, &local_endptr ); - if( endptr != NULL ) endptr = &local_endptr; + if (endptr) *endptr = local_endptr; - if( local_endptr == str ) { + if ( local_endptr == (char *)str ) { /* no conversion has been done */ /* for inputs like "abcdj", i.e. no number at all */ if( error == NULL ) { -- 2.47.3