On 2020-09-12 07:55, Jakub Wilk wrote:
* Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>, 2020-09-12, 01:14:- printf("%2ldh %2ldm %2lds", (ts.tv_sec % SECS_IN_DAY) / 3600, - (ts.tv_sec % 3600) / 60, ts.tv_sec % 60); + printf("%2jdh %2jdm %2jds", + (intmax_t) (ts.tv_sec % SECS_IN_DAY) / 3600, + (intmax_t) (ts.tv_sec % 3600) / 60, + (intmax_t) ts.tv_sec % 60);All these numbers are small, so %d and int casts would do the trick.
True. In this specific example '(int)' would be better. Thanks, Alex