1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +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
+3 -2
View File
@@ -148,8 +148,9 @@ xfer_buffer_refresh (const char *hotlist)
date_tmp = localtime (&(ptr_xfer->start_time));
if (date_tmp)
{
strftime (date, sizeof (date),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (date, sizeof (date),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
date[0] = '\0';
}
weechat_printf_y (xfer_buffer, (line * 2) + 3,
"%s%s%s %s%s%s%s%s",
+6 -4
View File
@@ -134,8 +134,9 @@ xfer_command_xfer_list (int full)
date_tmp = localtime (&(ptr_xfer->start_time));
if (date_tmp)
{
strftime (date, sizeof (date),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (date, sizeof (date),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
date[0] = '\0';
}
weechat_printf (NULL,
/* TRANSLATORS: "%s" after "started on" is a date */
@@ -171,8 +172,9 @@ xfer_command_xfer_list (int full)
date_tmp = localtime (&(ptr_xfer->start_transfer));
if (date_tmp)
{
strftime (date, sizeof (date),
"%a, %d %b %Y %H:%M:%S", date_tmp);
if (strftime (date, sizeof (date),
"%a, %d %b %Y %H:%M:%S", date_tmp) == 0)
date[0] = '\0';
}
weechat_printf (NULL,
/* TRANSLATORS: "%s" after "started on" is a date */