diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-09-22 21:50:01 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-09-23 15:06:28 +0200 |
commit | 5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3 (patch) | |
tree | e459fec713103315d7ae30aabd2269252ec77ab0 /src/plugins/trigger | |
parent | ae66a4d8a586555104dfe633a97fa4a2f17db531 (diff) | |
download | weechat-5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3.zip |
core, plugins: check return code of strftime function
Diffstat (limited to 'src/plugins/trigger')
-rw-r--r-- | src/plugins/trigger/trigger-callback.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index 79b2955a9..6dfcc4e0f 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -798,7 +798,9 @@ trigger_callback_print_cb (const void *pointer, void *data, date_tmp = localtime (&date); if (date_tmp) { - strftime (str_temp, sizeof (str_temp), "%Y-%m-%d %H:%M:%S", date_tmp); + if (strftime (str_temp, sizeof (str_temp), + "%Y-%m-%d %H:%M:%S", date_tmp) == 0) + str_temp[0] = '\0'; weechat_hashtable_set (extra_vars, "tg_date", str_temp); } snprintf (str_temp, sizeof (str_temp), "%d", displayed); @@ -940,7 +942,9 @@ trigger_callback_timer_cb (const void *pointer, void *data, date_tmp = localtime (&date); if (date_tmp) { - strftime (str_temp, sizeof (str_temp), "%Y-%m-%d %H:%M:%S", date_tmp); + if (strftime (str_temp, sizeof (str_temp), + "%Y-%m-%d %H:%M:%S", date_tmp) == 0) + str_temp[0] = '\0'; weechat_hashtable_set (extra_vars, "tg_date", str_temp); } |