projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The attached patch allows to
[rrdtool.git]
/
src
/
rrd_graph_helper.c
diff --git
a/src/rrd_graph_helper.c
b/src/rrd_graph_helper.c
index
c9990f7
..
456ab95
100644
(file)
--- a/
src/rrd_graph_helper.c
+++ b/
src/rrd_graph_helper.c
@@
-1,5
+1,5
@@
/****************************************************************************
/****************************************************************************
- * RRDtool 1.3
rc6
Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3
.2
Copyright by Tobi Oetiker, 1997-2008
****************************************************************************
* rrd_graph_helper.c commandline parser functions
* this code initially written by Alex van den Bogaerdt
****************************************************************************
* rrd_graph_helper.c commandline parser functions
* this code initially written by Alex van den Bogaerdt
@@
-516,10
+516,10
@@
int rrd_parse_textalign(
}
}
-/* Parsing of
PART,
VRULE, HRULE, LINE, AREA, STACK and TICK
+/* Parsing of VRULE, HRULE, LINE, AREA, STACK and TICK
** is done in one function.
**
** is done in one function.
**
-** Stacking
PART,
VRULE, HRULE or TICK is not allowed.
+** Stacking VRULE, HRULE or TICK is not allowed.
**
** If a number (which is valid to enter) is more than a
** certain amount of characters, it is caught as an error.
**
** If a number (which is valid to enter) is more than a
** certain amount of characters, it is caught as an error.
@@
-541,18
+541,12
@@
int rrd_parse_PVHLAST(
float one_space = gfx_get_text_width(im, 0,
im->
text_prop[TEXT_PROP_LEGEND].
float one_space = gfx_get_text_width(im, 0,
im->
text_prop[TEXT_PROP_LEGEND].
- font,
- im->
- text_prop[TEXT_PROP_LEGEND].
- size,
+ font_desc,
im->tabwidth, " ") / 4.0;
float target_space = gfx_get_text_width(im, 0,
im->
text_prop
im->tabwidth, " ") / 4.0;
float target_space = gfx_get_text_width(im, 0,
im->
text_prop
- [TEXT_PROP_LEGEND].font,
- im->
- text_prop
- [TEXT_PROP_LEGEND].size,
+ [TEXT_PROP_LEGEND].font_desc,
im->tabwidth, "oo");
spacecnt = target_space / one_space;
im->tabwidth, "oo");
spacecnt = target_space / one_space;
@@
-739,7
+733,7
@@
int rrd_parse_PVHLAST(
}
(*eaten)++; /* after colon */
}
(*eaten)++; /* after colon */
- /*
PART,
HRULE, VRULE and TICK cannot be stacked. */
+ /* HRULE, VRULE and TICK cannot be stacked. */
if ((gdp->gf != GF_HRULE)
&& (gdp->gf != GF_VRULE)
&& (gdp->gf != GF_TICK)) {
if ((gdp->gf != GF_HRULE)
&& (gdp->gf != GF_VRULE)
&& (gdp->gf != GF_TICK)) {
@@
-868,6
+862,10
@@
int rrd_parse_make_vname(
rrd_set_error("Cannot parse vname from '%s'", line);
return 1;
}
rrd_set_error("Cannot parse vname from '%s'", line);
return 1;
}
+ if (line[*eaten+i] == '\0') {
+ rrd_set_error("String ends after the = sign on '%s'", line);
+ return 1;
+ }
dprintf("- found candidate '%s'\n", tmpstr);
if ((gdp->vidx = find_var(im, tmpstr)) >= 0) {
dprintf("- found candidate '%s'\n", tmpstr);
if ((gdp->vidx = find_var(im, tmpstr)) >= 0) {
@@
-889,7
+887,7
@@
int rrd_parse_def(
int i = 0;
char command[7]; /* step, start, end, reduce */
char tmpstr[256];
int i = 0;
char command[7]; /* step, start, end, reduce */
char tmpstr[256];
-
struct rrd_time_value
start_tv, end_tv;
+
rrd_time_value_t
start_tv, end_tv;
time_t start_tmp = 0, end_tmp = 0;
char *parsetime_error = NULL;
time_t start_tmp = 0, end_tmp = 0;
char *parsetime_error = NULL;
@@
-951,7
+949,7
@@
int rrd_parse_def(
} else if (!strcmp("start", command)) {
i = scan_for_col(&line[*eaten], 255, tmpstr);
(*eaten) += i;
} else if (!strcmp("start", command)) {
i = scan_for_col(&line[*eaten], 255, tmpstr);
(*eaten) += i;
- if ((parsetime_error = parsetime(tmpstr, &start_tv))) {
+ if ((parsetime_error =
rrd_
parsetime(tmpstr, &start_tv))) {
rrd_set_error("start time: %s", parsetime_error);
return 1;
}
rrd_set_error("start time: %s", parsetime_error);
return 1;
}
@@
-959,7
+957,7
@@
int rrd_parse_def(
} else if (!strcmp("end", command)) {
i = scan_for_col(&line[*eaten], 255, tmpstr);
(*eaten) += i;
} else if (!strcmp("end", command)) {
i = scan_for_col(&line[*eaten], 255, tmpstr);
(*eaten) += i;
- if ((parsetime_error = parsetime(tmpstr, &end_tv))) {
+ if ((parsetime_error =
rrd_
parsetime(tmpstr, &end_tv))) {
rrd_set_error("end time: %s", parsetime_error);
return 1;
}
rrd_set_error("end time: %s", parsetime_error);
return 1;
}
@@
-978,8
+976,8
@@
int rrd_parse_def(
}
(*eaten)++;
}
}
(*eaten)++;
}
- if (proc_start_end(&start_tv, &end_tv, &start_tmp, &end_tmp) == -1) {
- /* error string is set in parsetime.c */
+ if (
rrd_
proc_start_end(&start_tv, &end_tv, &start_tmp, &end_tmp) == -1) {
+ /* error string is set in
rrd_
parsetime.c */
return 1;
}
if (start_tmp < 3600 * 24 * 365 * 10) {
return 1;
}
if (start_tmp < 3600 * 24 * 365 * 10) {