From: TheWitness Date: Fri, 15 Nov 2024 22:21:51 +0000 (-0500) Subject: Revert to floor() function after review of diff X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79ca2cfdfbeda641bb70576ce9ea4288c8d0468a;p=thirdparty%2Frrdtool-1.x.git Revert to floor() function after review of diff --- diff --git a/src/rrd_xport.c b/src/rrd_xport.c index 75c96092..ea5b6325 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -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]; }