/****************************************************************************
- * RRDtool 1.2.13 Copyright by Tobi Oetiker, 1997-2006
+ * RRDtool 1.2.15 Copyright by Tobi Oetiker, 1997-2006
****************************************************************************
* rrd_graph_helper.c commandline parser functions
* this code initially written by Alex van den Bogaerdt
rrd_set_error("Malformed '%s' command in line '%s'\n",&line[*eaten],line);
return 1;
}
+ if (line[*eaten] == '\0') {
+ rrd_set_error("Expected some arguments after '%s'\n",line);
+ return 1;
+ }
return 0;
}
rrd_parse_print(const char *const line, unsigned int *const eaten, graph_desc_t *const gdp, image_desc_t *const im) {
/* vname:CF:format in case of DEF-based vname
** vname:CF:format in case of CDEF-based vname
- ** vname:format in case of VDEF-based vname
+ ** vname:format[:strftime] in case of VDEF-based vname
*/
if ((gdp->vidx=rrd_parse_find_vname(line,eaten,gdp,im))<0) return 1;
get the format at this juncture */
strcpy(gdp->format,gdp->legend);
gdp->legend[0]='\0';
+ /* this is a very crud test, parsing :style flags should be in a function */
+ if (im->gdes[gdp->vidx].gf == GF_VDEF && strcmp(line+(*eaten),":strftime")==0){
+ gdp->strftm = 1;
+ (*eaten)+=strlen(":strftime");
+ }
return 0;
}