]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Revert to floor() function after review of diff
authorTheWitness <thewitness@cacti.net>
Fri, 15 Nov 2024 22:21:51 +0000 (17:21 -0500)
committerGitHub <noreply@github.com>
Fri, 15 Nov 2024 22:21:51 +0000 (17:21 -0500)
src/rrd_xport.c

index 75c960927a31ed7327b9d01e8af04f78a2e918bf..ea5b6325fe2eb973bd4ef6c9b99c4c0041044adf 100644 (file)
@@ -416,7 +416,7 @@ static int rrd_xport_fn(
             time_t     now = *start + dst_row * *step;
 
             if (im->gdes[vidx].step > 0) {
-                chosen_idx = ceil((double) (now - im->gdes[vidx].start) / im->gdes[vidx].step) * im->gdes[vidx].ds_cnt + im->gdes[vidx].ds;
+                chosen_idx = floor((double) (now - im->gdes[vidx].start) / im->gdes[vidx].step) * im->gdes[vidx].ds_cnt + im->gdes[vidx].ds;
 
                 (*dstptr++) = im->gdes[vidx].data[chosen_idx];
             }