Code

using --riggid it is possible to get a case where minval is bigger than maxval ....
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Fri, 26 Dec 2003 16:54:55 +0000 (16:54 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Fri, 26 Dec 2003 16:54:55 +0000 (16:54 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@229 a5681a0c-68f1-0310-ab6d-d61299d08faa

program/src/rrd_graph.c

index c60717fa0828784601476464480d6d33a7e2f6dd..afcbc0147072fd6faf981b307f130c14b0e9e101 100644 (file)
@@ -1072,6 +1072,11 @@ data_proc( image_desc_t *im ){
        else
            im->maxval = maxval;
     }
+    /* make sure min is smaller than max */
+    if (im->minval > im->maxval) {
+            im->minval = 0.99 * im->maxval;
+    }
+                      
     /* make sure min and max are not equal */
     if (im->minval == im->maxval) {
        im->maxval *= 1.01;