From 0ee79295f604fdc52b3462065779655b0a2a65f4 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 20 Dec 2023 17:56:32 +0100 Subject: [PATCH] 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 --- lib/defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/defines.h b/lib/defines.h index b644036c..049c0506 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)