1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06: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
+4 -1
View File
@@ -5462,7 +5462,10 @@ weechat_ruby_api_infolist_time (VALUE class, VALUE infolist, VALUE variable)
time = weechat_infolist_time (API_STR2PTR(c_infolist), c_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);