From: Lennart Poettering Date: Thu, 30 Apr 2020 11:18:45 +0000 (+0200) Subject: calendarspec: encode that it's OK to store µs in 'int's X-Git-Tag: v246-rc1~442^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4d6d711cf0a96aa282ace6afe49b3df9c1bf334;p=thirdparty%2Fsystemd.git calendarspec: encode that it's OK to store µs in 'int's --- diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 4103cf3ef02..7da3fb7211d 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;