1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 23:36:37 +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 -4
View File
@@ -96,8 +96,9 @@ relay_buffer_refresh (const char *hotlist)
date_tmp = localtime (&(ptr_client->start_time));
if (date_tmp)
{
strftime (str_date_start, sizeof (str_date_start),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (str_date_start, sizeof (str_date_start),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
str_date_start[0] = '\0';
}
str_date_end[0] = '-';
str_date_end[1] = '\0';
@@ -106,8 +107,9 @@ relay_buffer_refresh (const char *hotlist)
date_tmp = localtime (&(ptr_client->end_time));
if (date_tmp)
{
strftime (str_date_end, sizeof (str_date_end),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (str_date_end, sizeof (str_date_end),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
str_date_end[0] = '\0';
}
}