diff options
-rw-r--r-- | window-clock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/window-clock.c b/window-clock.c index e84635f6..49239180 100644 --- a/window-clock.c +++ b/window-clock.c @@ -93,13 +93,13 @@ void window_clock_timer(struct window_pane *wp) { struct window_clock_mode_data *data = wp->modedata; - struct tm *now, *then; + struct tm now, then; time_t t; t = time(NULL); - now = gmtime(&t); - then = gmtime(&data->tim); - if (now->tm_min == then->tm_min) + gmtime_r(&t, &now); + gmtime_r(&data->tim, &then); + if (now.tm_min == then.tm_min) return; data->tim = t; |