1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

core, plugins: check return code of strftime function

This commit is contained in:
Sébastien Helleu
2017-09-22 21:50:01 +02:00
parent ae66a4d8a5
commit 5aab494dd6
23 changed files with 130 additions and 72 deletions
+6 -2
View File
@@ -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);
}