1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16: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 -3
View File
@@ -452,9 +452,10 @@ irc_ctcp_replace_variables (struct t_irc_server *server, const char *format)
now = time (NULL);
local_time = localtime (&now);
setlocale (LC_ALL, "C");
strftime (buf, sizeof (buf),
weechat_config_string (irc_config_look_ctcp_time_format),
local_time);
if (strftime (buf, sizeof (buf),
weechat_config_string (irc_config_look_ctcp_time_format),
local_time) == 0)
buf[0] = '\0';
setlocale (LC_ALL, "");
temp = weechat_string_replace (res, "$time", buf);
free (res);