/****************************************************************************
- * RRDtool 1.2.15 Copyright by Tobi Oetiker, 1997-2006
+ * RRDtool 1.2.19 Copyright by Tobi Oetiker, 1997-2007
****************************************************************************
* rrd__graph.c produce graphs from data in rrdfiles
****************************************************************************/
#include <sys/stat.h>
+#ifdef WIN32
+#include "strftime.h"
+#endif
#include "rrd_tool.h"
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
-#include "strftime.h"
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
#include <io.h>
#include <fcntl.h>
#endif
** relevant for min and max
*/
if (finite(paintval) && im->gdes[ii].gf != GF_TICK ) {
- if (isnan(minval) || paintval < minval)
- minval = paintval;
+ if ((isnan(minval) || paintval < minval ) &&
+ ! (im->logarithmic && paintval <= 0.0))
+ minval = paintval;
if (isnan(maxval) || paintval > maxval)
maxval = paintval;
}
} else {
prt_fctn = '\0';
}
+ /* only valid control codes */
+ if (prt_fctn != 'l' &&
+ prt_fctn != 'n' && /* a synonym for l */
+ prt_fctn != 'r' &&
+ prt_fctn != 'j' &&
+ prt_fctn != 'c' &&
+ prt_fctn != 's' &&
+ prt_fctn != 't' &&
+ prt_fctn != '\0' &&
+ prt_fctn != 'g' ) {
+ free(legspace);
+ rrd_set_error("Unknown control code at the end of '%s\\%c'",im->gdes[i].legend,prt_fctn);
+ return -1;
+
+ }
+
/* remove exess space */
+ if ( prt_fctn == 'n' ){
+ prt_fctn='l';
+ }
+
while (prt_fctn=='g' &&
leg_cc > 0 &&
im->gdes[i].legend[leg_cc-1]==' '){