- /* If a color is specified and the only remaining part is
- ** ":STACK" then it is assumed to be the legend. An empty
- ** legend can be specified as expected. This means the
- ** following can be done: LINE1:x#FF0000FF::STACK
- */
- if (colorfound) { /* no legend if no color */
- if (gdp->gf == GF_TICK) {
- dprintf("- looking for optional number\n");
- sscanf(&line[*eaten],"%lf%n",&gdp->yrule,&j);
- if (j) {
- dprintf("- found number %f\n",gdp->yrule);
- (*eaten)+=j;
- if (gdp->yrule > 1.0 || gdp->yrule < -1.0) {
- rrd_set_error("Tick factor should be <= 1.0");
- return 1;
- }
- if (line[*eaten] == ':')
- (*eaten)++;
- } else {
- dprintf("- not found, defaulting to 0.1\n");
- gdp->yrule=0.1;
- return 0;
+ (*eaten) += i; /* after vname#color */
+ if (line[*eaten]!='\0') {
+ (*eaten)++; /* after colon */
+ }
+
+ if (gdp->gf == GF_TICK) {
+ dprintf("- parsing '%s'\n",&line[*eaten]);
+ dprintf("- looking for optional TICK number\n");
+ j=0;
+ sscanf(&line[*eaten],"%lf%n",&gdp->yrule,&j);
+ if (j) {
+ if (line[*eaten+j]!='\0' && line[*eaten+j]!=':') {
+ rrd_set_error("Cannot parse TICK fraction '%s'",line);
+ return 1;
+ }
+ dprintf("- found number %f\n",gdp->yrule);
+ if (gdp->yrule > 1.0 || gdp->yrule < -1.0) {
+ rrd_set_error("Tick factor should be <= 1.0");
+ return 1;