Changed comparison "if (secs > 0)" to "if (secs >= 0)" to handle
condition (secs == 0) correctly. Suggestions to improve the
less-than-elegant if-else chain are welcome.
Signed-off-by: Karel Zak <kzak@redhat.com>
sprintf(length, "(%d+%02d:%02d)", days, abs(hours), abs(mins)); /* hours and mins always shown as positive (w/o minus sign!) even if secs < 0 */
} else if (hours) {
sprintf(length, " (%02d:%02d)", hours, abs(mins)); /* mins always shown as positive (w/o minus sign!) even if secs < 0 */
- } else if (secs > 0) {
+ } else if (secs >= 0) {
sprintf(length, " (%02d:%02d)", hours, mins);
} else {
sprintf(length, " (-00:%02d)", abs(mins)); /* mins always shown as positive (w/o minus sign!) even if secs < 0 */