diff options
author | Rich Felker <dalias@aerifal.cx> | 2020-01-11 11:07:35 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-01-11 18:55:26 -0600 |
commit | c6e79470ab5cfe3fc75fe95bfedaf44304d264ec (patch) | |
tree | e2277d5d2261079a47f5fc00ded8acbb4ba54e3f | |
parent | cb455b403b54b68a55d95c348c3c53bc6caa0790 (diff) | |
download | toybox-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.
-rw-r--r-- | toys/posix/find.c | 2 |
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') { |