star-meteo

Time varying meteorological data
git clone git://git.meso-star.fr/star-meteo.git
Log | Files | Refs | README | LICENSE

commit 36808aba7fdb95a4ccaebd041bce3fe65ef166ae
parent 63a679996fac9c23fcb841a9e99c9667d14f8144
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 14 Aug 2025 12:01:19 +0200

stardis: check the selected time interval (debug)

Diffstat:
Msrc/stardis_smeteo.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/stardis_smeteo.c b/src/stardis_smeteo.c @@ -100,6 +100,10 @@ get_meteo_entry_id half_interval_duration = bcond->lib_desc.smeteo_desc.entries[0].day_1850; if(found->day_1850 - time_1850 > half_interval_duration) --found; + /* Check that the input time is within the selected time interval */ + ASSERT(time_1850 >= found->day_1850 - half_interval_duration); + ASSERT(time_1850 <= found->day_1850 + half_interval_duration); + /* Calculate the index of the selected interval */ ASSERT((intptr_t)found >= (intptr_t)bcond->lib_desc.smeteo_desc.entries); return (size_t)(found - bcond->lib_desc.smeteo_desc.entries);