From c6e79470ab5cfe3fc75fe95bfedaf44304d264ec Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 11 Jan 2020 11:07:35 -0500 Subject: find.c: don't assume time_t is the same as long This is false on ILP32 targets with 64-bit time_t. --- toys/posix/find.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/find.c b/toys/posix/find.c index 8a837385..3fb97b1c 100644 --- a/toys/posix/find.c +++ b/toys/posix/find.c @@ -636,7 +636,7 @@ static int do_find(struct dirtree *new) } else if (ch == 'p') ll = (long)(ff = dirtree_path(new, 0)); else if (ch == 'T') { if (*++fmt!='@') error_exit("bad -printf %%T: %%T%c", *fmt); - sprintf(buf, "%ld.%ld", new->st.st_mtim.tv_sec, + sprintf(buf, "%lld.%ld", (long long)new->st.st_mtim.tv_sec, new->st.st_mtim.tv_nsec); ll = (long)buf; } else if (ch == 'Z') { -- cgit v1.2.3