From: Upasana Date: Fri, 11 Jul 2014 17:17:26 +0000 (+0530) Subject: *endptr should be set in rrd_strtoding, not endptr X-Git-Tag: v1.5.0-rc1~63^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=831f4a98c660aaff695b906db416cc3df4cccb5c;p=thirdparty%2Frrdtool-1.x.git *endptr should be set in rrd_strtoding, not endptr so that value is reflected in the callee function as well --- 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 ) {