X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=6df9b0966b30ed7e89faa8ee3b3143513ec28cf6;hb=674dee5af23a9cf9488f11880368c64a5ad70026;hp=cd5bdfc16f05050a807b5cd22bb12a8c567e8814;hpb=6d3c7a4dbcaab12855cf70d7f22b827190156ae9;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index cd5bdfc..6df9b09 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2.15 Copyright by Tobi Oetiker, 1997-2006 + * RRDtool 1.2.18 Copyright by Tobi Oetiker, 1997-2006 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -7,10 +7,12 @@ #include +#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 #include #endif @@ -1062,8 +1064,9 @@ data_proc( image_desc_t *im ){ ** 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; } @@ -1443,7 +1446,27 @@ leg_place(image_desc_t *im) } 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]==' '){