1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 10:13:12 +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
@@ -4804,8 +4804,9 @@ hook_print_log ()
local_time = localtime (&seconds);
if (local_time)
{
strftime (text_time, sizeof (text_time),
"%d/%m/%Y %H:%M:%S", local_time);
if (strftime (text_time, sizeof (text_time),
"%d/%m/%Y %H:%M:%S", local_time) == 0)
text_time[0] = '\0';
}
log_printf (" last_exec.tv_sec. . . : %lld (%s)",
(long long)(HOOK_TIMER(ptr_hook, last_exec.tv_sec)),
@@ -4816,8 +4817,9 @@ hook_print_log ()
local_time = localtime (&seconds);
if (local_time)
{
strftime (text_time, sizeof (text_time),
"%d/%m/%Y %H:%M:%S", local_time);
if (strftime (text_time, sizeof (text_time),
"%d/%m/%Y %H:%M:%S", local_time) == 0)
text_time[0] = '\0';
}
log_printf (" next_exec.tv_sec. . . : %lld (%s)",
(long long)(HOOK_TIMER(ptr_hook, next_exec.tv_sec)),