]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
calendarspec: encode that it's OK to store µs in 'int's
authorLennart Poettering <lennart@poettering.net>
Thu, 30 Apr 2020 11:18:45 +0000 (13:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 May 2020 06:57:14 +0000 (08:57 +0200)
src/shared/calendarspec.c

index 4103cf3ef0289d7024ca69f5edb118ab23b4e7da..7da3fb7211d5b1fd187f6d0ee4c3454a5355f997 100644 (file)
@@ -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;