From a4d6d711cf0a96aa282ace6afe49b3df9c1bf334 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 30 Apr 2020 13:18:45 +0200 Subject: [PATCH] =?UTF-8?q?calendarspec:=20encode=20that=20it's=20OK=20to?= =?UTF-8?q?=20store=20=C2=B5s=20in=20'int's?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/calendarspec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 4103cf3ef0..7da3fb7211 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -30,6 +30,9 @@ * linked compenents anyway. */ #define CALENDARSPEC_COMPONENTS_MAX 240 +/* Let's make sure that the microsecond component is safe to be stored in an 'int' */ +assert_cc(INT_MAX >= USEC_PER_SEC); + static void chain_free(CalendarComponent *c) { CalendarComponent *n;