diff options
Diffstat (limited to 'apps/wps-display.c')
-rw-r--r-- | apps/wps-display.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c index c6621b1e62..563bb265be 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c | |||
@@ -478,10 +478,14 @@ static char* get_tag(struct mp3entry* id3, | |||
478 | return buf; | 478 | return buf; |
479 | 479 | ||
480 | case 't': /* estimated battery time */ | 480 | case 't': /* estimated battery time */ |
481 | snprintf(buf, buf_size, "%dh %dm", | 481 | { |
482 | battery_time() / 60, | 482 | int t = battery_time(); |
483 | battery_time() % 60); | 483 | if (t >= 0) |
484 | snprintf(buf, buf_size, "%dh %dm", t / 60, t % 60); | ||
485 | else | ||
486 | strncpy(buf, "?h ?m", buf_size); | ||
484 | return buf; | 487 | return buf; |
488 | } | ||
485 | } | 489 | } |
486 | break; | 490 | break; |
487 | 491 | ||