diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-09-22 21:50:01 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-09-23 15:06:28 +0200 |
commit | 5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3 (patch) | |
tree | e459fec713103315d7ae30aabd2269252ec77ab0 /src/plugins/relay/irc/relay-irc.c | |
parent | ae66a4d8a586555104dfe633a97fa4a2f17db531 (diff) | |
download | weechat-5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3.zip |
core, plugins: check return code of strftime function
Diffstat (limited to 'src/plugins/relay/irc/relay-irc.c')
-rw-r--r-- | src/plugins/relay/irc/relay-irc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 1da5835b9..813f65cac 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -726,7 +726,8 @@ relay_irc_get_line_info (struct t_relay_client *client, && time_format && time_format[0]) { tm = localtime (&msg_date); - strftime (str_time, sizeof (str_time), time_format, tm); + if (strftime (str_time, sizeof (str_time), time_format, tm) == 0) + str_time[0] = '\0'; length = strlen (str_time) + strlen (pos) + 1; *message = malloc (length); if (*message) @@ -741,7 +742,8 @@ relay_irc_get_line_info (struct t_relay_client *client, && (RELAY_IRC_DATA(client, server_capabilities) & (1 << RELAY_IRC_CAPAB_SERVER_TIME))) { tm = gmtime (&msg_date); - strftime (str_time, sizeof (str_time), "%Y-%m-%dT%H:%M:%S", tm); + if (strftime (str_time, sizeof (str_time), "%Y-%m-%dT%H:%M:%S", tm) == 0) + str_time[0] = '\0'; snprintf (str_tag, sizeof (str_tag), "@time=%s.000Z ", str_time); *tags = strdup (str_tag); } |