truncate: avoid integer-overflow assumptions
commit86ee5548c186e82f25e1aad9bdae8edda22b7178
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Oct 2019 19:41:22 +0000 (3 12:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Oct 2019 19:41:51 +0000 (3 12:41 -0700)
tree2378bb3ccb5959850fe9d754d8a0bed8f2336570
parentba1ea8caeebe9e93a40a5f05d6ff3df2afdc63ab
truncate: avoid integer-overflow assumptions

* src/truncate.c (do_ftruncate): Simplify overflow checking,
and don’t rely on theoretically-nonportable assumptions
like assuming that OFF_MAX < UINTMAX_MAX.
src/truncate.c