aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2024-12-27 12:33:21 -0500
committerDave Barach <vpp@barachs.net>2024-12-27 18:02:20 +0000
commitd11d31653d948c9f3ac80afd69f111657b007f0f (patch)
tree0e8ba786b4864c038f8c34f36fcc6deb4b1bd68d /src/vppinfra
parent6d4dbd4f29d6789cf4ea799d0b2eb9d489fa339d (diff)
vppinfra: fix time range conversion off-by-1s
Type: fix Change-Id: I869e657744e9bba81994ad426731a08e5f1bcad7 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/time_range.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vppinfra/time_range.c b/src/vppinfra/time_range.c
index 54f5629641a..72ed840e7c1 100644
--- a/src/vppinfra/time_range.c
+++ b/src/vppinfra/time_range.c
@@ -120,7 +120,7 @@ clib_timebase_time_to_components (f64 now, clib_timebase_component_t * cp)
now = now - ((f64) days_in_year) * 86400.0;
year++;
}
- while (now > 0.0);
+ while (now >= 0.0);
days_since_epoch -= days_in_year;
now += ((f64) days_in_year) * 86400;
@@ -138,7 +138,7 @@ clib_timebase_time_to_components (f64 now, clib_timebase_component_t * cp)
now = now - ((f64) days_in_month) * 86400.0;
month++;
}
- while (now > 0.0);
+ while (now >= 0.0);
days_since_epoch -= days_in_month;
now += ((f64) days_in_month) * 86400;
@@ -151,7 +151,7 @@ clib_timebase_time_to_components (f64 now, clib_timebase_component_t * cp)
day_of_month++;
days_since_epoch++;
}
- while (now > 0.0);
+ while (now >= 0.0);
day_of_month--;
days_since_epoch--;