1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-18 17:14:47 +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
+4 -1
View File
@@ -4510,7 +4510,10 @@ API_FUNC(infolist_time)
variable);
date_tmp = localtime (&time);
if (date_tmp)
strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp);
{
if (strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp) == 0)
timebuffer[0] = '\0';
}
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);