check to see if the allowed time is over, which should make rsync exit more
consistently.
- - Tweak the snprintf() in progress.c that turns the remaining time into a
- HHHH:MM:SS value to avoid putting a -8 into the SS or MM spots when the
- remaining seconds is so large that it overflows the integer arithmetic
- trying to perform a modulus.
+ - Tweak --progress to display "??:??:??" when the time-remaining value is
+ so large as to be meaningless.
### ENHANCEMENTS:
units = "kB/s";
}
- if (remain < 0)
+ if (remain < 0 || remain > 9999.0 * 3600.0)
strlcpy(rembuf, " ??:??:??", sizeof rembuf);
else {
- snprintf(rembuf, sizeof rembuf, "%4lu:%02u:%02u",
- (unsigned long) (remain / 3600.0),
+ snprintf(rembuf, sizeof rembuf, "%4u:%02u:%02u",
+ (unsigned int) (remain / 3600.0),
(unsigned int) (remain / 60.0) % 60,
(unsigned int) remain % 60);
}