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
+9 -6
View File
@@ -66,16 +66,18 @@ relay_command_client_list (int full)
date_tmp = localtime (&(ptr_client->start_time));
if (date_tmp)
{
strftime (date_start, sizeof (date_start),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (date_start, sizeof (date_start),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
date_start[0] = '\0';
}
date_activity[0] = '\0';
date_tmp = localtime (&(ptr_client->last_activity));
if (date_tmp)
{
strftime (date_activity, sizeof (date_activity),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (date_activity, sizeof (date_activity),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
date_activity[0] = '\0';
}
if (full)
@@ -156,8 +158,9 @@ relay_command_server_list ()
date_tmp = localtime (&(ptr_server->start_time));
if (date_tmp)
{
strftime (date_start, sizeof (date_start),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (date_start, sizeof (date_start),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
date_start[0] = '\0';
}
weechat_printf (
NULL,