Skip to content

Commit cb161e1

Browse files
authored
gtkui: prevent total playtime from being cast to int (fixes #3270) (#3271)
1 parent 2be458d commit cb161e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/gtkui/gtkui.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ gtkui_dispatch_on_main (void (^block) (void)) {
164164
static void
165165
format_timestr (char *buf, int sz, float time) {
166166
time = roundf (time);
167-
int daystotal = (int)time / (3600 * 24);
168-
int hourtotal = ((int)time / 3600) % 24;
169-
int mintotal = ((int)time / 60) % 60;
170-
int sectotal = ((int)time) % 60;
167+
int daystotal = (int64_t)time / (3600 * 24);
168+
int hourtotal = ((int64_t)time / 3600) % 24;
169+
int mintotal = ((int64_t)time / 60) % 60;
170+
int sectotal = ((int64_t)time) % 60;
171171

172172
if (daystotal == 0) {
173173
snprintf (buf, sz, "%d:%02d:%02d", hourtotal, mintotal, sectotal);

0 commit comments

Comments
 (0)