From: Alejandro Colomar Date: Wed, 20 Dec 2023 16:56:32 +0000 (+0100) Subject: lib/defines.h: Use 'time_t' for DAY X-Git-Tag: 4.15.0-rc1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ee79295f604fdc52b3462065779655b0a2a65f4;p=thirdparty%2Fshadow.git lib/defines.h: Use 'time_t' for DAY Special care has to be taken for 32 bit systems with a 64 bit time_t, since their long data type is still 32 bit. Since this macro expresses a number of seconds, and seconds are in units of 'time_t' in C, the appropriate type for the multiplication is 'time_t'. Reported-by: Tobias Stoeckmann Signed-off-by: Alejandro Colomar --- diff --git a/lib/defines.h b/lib/defines.h index b644036cf..049c0506c 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -144,7 +144,7 @@ /* Solaris defines this in shadow.h */ #ifndef DAY -#define DAY (24L*3600L) +#define DAY ((time_t) 24 * 3600) #endif #define WEEK (7*DAY)