diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-10 13:35:25 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-10 13:35:25 +0200 |
commit | ccf18f4bf64bb20fb80b8d16781c21a9fbde5f96 (patch) | |
tree | 9820269272cc66d3ad2c966d57f1ed281ce454cb /src | |
parent | fc1571645d1c776fc33b32300de9be09362ba867 (diff) | |
download | weechat-ccf18f4bf64bb20fb80b8d16781c21a9fbde5f96.zip |
core: return immediately if localtime fails in window scroll
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/gui-window.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index e368636a9..425c16f36 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -1191,8 +1191,9 @@ gui_window_scroll (struct t_gui_window *window, char *scroll) { old_date = ptr_line->data->date; date_tmp = localtime (&old_date); - if (date_tmp) - memcpy (&old_line_date, date_tmp, sizeof (struct tm)); + if (!date_tmp) + return; + memcpy (&old_line_date, date_tmp, sizeof (struct tm)); } while (ptr_line) @@ -1213,8 +1214,9 @@ gui_window_scroll (struct t_gui_window *window, char *scroll) else { date_tmp = localtime (&(ptr_line->data->date)); - if (date_tmp) - memcpy (&line_date, date_tmp, sizeof (struct tm)); + if (!date_tmp) + return; + memcpy (&line_date, date_tmp, sizeof (struct tm)); if (old_date > ptr_line->data->date) diff_date = old_date - ptr_line->data->date; else |