From: erg Date: Wed, 21 Jul 2010 21:13:05 +0000 (+0000) Subject: Replace strtof with strtod - the former isn't available on Windows and is buggy on... X-Git-Tag: LAST_LIBGRAPH~32^2~1251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78658638157656aff330c35d97cce7ed66dc862d;p=graphviz Replace strtof with strtod - the former isn't available on Windows and is buggy on linux. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 9b0aac06c..a62892209 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1483,23 +1483,18 @@ freeSegs (colorsegs_t* segs) * Return 0 for 0-length prefix, i.e., prev_v is also 0. * Return -1 on failure */ -static float getSegLen (char* s, float prev_v) +static double getSegLen (char* s, double prev_v) { char* p = strchr (s, ','); char* endp; - float v; + double v; if (!p) { agerr (AGERR, "No comma in color spec \"%s\" in color attribute ", s); return -1; } *p++ = '\0'; -#ifndef WIN32 v = strtod (p, &endp); -#else - v =(float) strtod (p, &endp); -#endif - if (endp != p) { /* scanned something */ if ((prev_v < v) && (v < 1)) return v; @@ -1524,7 +1519,7 @@ parseSegs (char* clrs, int nseg) char* colors = strdup (clrs); char* color; int cnum = 0; - float v, prev_v = 0; + double v, prev_v = 0; segs->base = colors; segs->segs = s = N_NEW(nseg+1,colorseg_t);