]> arthur.barton.de Git - netdata.git/commitdiff
fixed a bug where charts were giving no data if the whole data range should be evaluated
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 3 Dec 2015 07:48:50 +0000 (09:48 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 3 Dec 2015 07:48:50 +0000 (09:48 +0200)
src/rrd2json.c

index 6539ace43461b6708dcedae4a1b79f11e8c3afa7..b15fb02ae5b775edc98121d4936781e1e396a84f 100755 (executable)
@@ -1625,9 +1625,10 @@ unsigned long rrd_stats_json(int type, RRDSET *st, BUFFER *wb, int points, int g
                                        , stop_at_t
                                        );
 
-               for(; !stop_now ; now -= dt, t--) {
+               long counter = 0;
+               for(; !stop_now ; now -= dt, t--, counter++) {
                        if(t < 0) t = st->entries - 1;
-                       if(t == stop_at_t) stop_now = 1;
+                       if(t == stop_at_t) stop_now = counter;
 
                        int print_this = 0;