aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-01-11 11:07:35 -0500
committerRob Landley <rob@landley.net>2020-01-11 18:55:26 -0600
commitc6e79470ab5cfe3fc75fe95bfedaf44304d264ec (patch)
treee2277d5d2261079a47f5fc00ded8acbb4ba54e3f /toys/posix
parentcb455b403b54b68a55d95c348c3c53bc6caa0790 (diff)
downloadtoybox-c6e79470ab5cfe3fc75fe95bfedaf44304d264ec.tar.gz
find.c: don't assume time_t is the same as long
This is false on ILP32 targets with 64-bit time_t.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/find.c2
1 files changed, 1 insertions, 1 deletions
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') {