summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5d61d72)
raw | patch | inline | side by side (parent: 5d61d72)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 1 May 2005 10:20:55 +0000 (10:20 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 1 May 2005 10:20:55 +0000 (10:20 +0000) |
eg. LINE1.2323:
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@458 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@458 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_graph_helper.c | patch | blob | history |
index 0ab38fed9c96605feb3419789931f84d8da27fcc..653586f3829e464511b741cfc458c1ad3318c18d 100644 (file)
int
rrd_parse_find_gf(char *line, unsigned int *eaten, graph_desc_t *gdp) {
- char funcname[11],c1=0,c2=0;
+ char funcname[11],c1=0;
int i=0;
sscanf(&line[*eaten], "DEBUG%n", &i);
i=0;
dprintf("Scanning line '%s'\n",&line[*eaten]);
}
- sscanf(&line[*eaten], "%10[A-Z]%n%c%c", funcname, &i, &c1, &c2);
+ sscanf(&line[*eaten], "%10[A-Z]%n%c", funcname, &i, &c1);
if (!i) {
rrd_set_error("Could not make sense out of '%s'",line);
return 1;
return 1;
}
if (gdp->gf == GF_LINE) {
- if (c1 < '1' || c1 > '3' || c2 != ':') {
- rrd_set_error("Malformed LINE command: %s",line);
- return 1;
+ if (c1 == ':'){
+ gdp->linewidth=1;
+ } else {
+ double width;
+ *eaten+=i;
+ if (sscanf(&line[*eaten],"%lf%n:",&width,&i)){
+ if (width <= 0){
+ rrd_set_error("LINE width is %lf. It must be >= 0 though",width);
+ return 1;
+ }
+ gdp->linewidth=width;
+ } else {
+ rrd_set_error("LINE width: %s",line);
+ return 1;
+ }
}
- gdp->linewidth=c1-'0';
- i++;
} else {
if (c1 != ':') {
rrd_set_error("Malformed %s command: %s",funcname,line);