From cc7af09ae09ae20565e61f7d33b5ec0329797647 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 12 Apr 2024 22:55:05 +0200 Subject: mtd-utils: fectest: Fix time formatting with _TIME_BITS=64 on 32-bit system fectest.c formats a struct timeval with the assumption that time_t and suseconds_t are aliases for long, but some 32-bit systems now define them as long long in order to support timestamps beyond 2038. As this is an elapsed time and not a timestamp, both fields should be within the range of long, so cast them to long before formatting rather than moving to long long. Signed-off-by: Ben Hutchings Reviewed-by: Zhihao Cheng Signed-off-by: David Oberhollenzer --- misc-utils/fectest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc-utils') diff --git a/misc-utils/fectest.c b/misc-utils/fectest.c index eb1d33e..f560f2b 100644 --- a/misc-utils/fectest.c +++ b/misc-utils/fectest.c @@ -87,6 +87,6 @@ int main(void) exit(1); } - printf("Decoded in %ld.%06lds\n", now.tv_sec, now.tv_usec); + printf("Decoded in %ld.%06lds\n", (long)now.tv_sec, (long)now.tv_usec); return 0; } -- cgit v1.2.3