Clamp the calculated ETA to within the size of a long integer to avoid over/underflows, and round off the floating point value rather than just truncating the decimal portion.

This commit is contained in:
Andrew Wood
2026-04-19 17:57:32 +01:00
parent c19d16b3c8
commit b2f44b6724
11 changed files with 55 additions and 33 deletions
+1
View File
@@ -10,6 +10,7 @@
* *cleanup:* fix warning in pv_remote_check() stub on OpenBSD
* *cleanup:* use dynamic line buffers for **--watchfd** process lookups
* *cleanup:* replace the blanket 100,000-hour clamp on displayed times with a million days for timer and ETA, and 7,000 years for estimated finish time, on 64-bit systems
* *cleanup:* use rounding when calculating ETA, and avoid integer overflows, particularly on 32-bit systems
* *cleanup:* standardise the error reporting mechanism
* *cleanup:* improve code comments