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/python | |
parent | ae66a4d8a586555104dfe633a97fa4a2f17db531 (diff) | |
download | weechat-5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3.zip |
core, plugins: check return code of strftime function
Diffstat (limited to 'src/plugins/python')
-rw-r--r-- | src/plugins/python/weechat-python-api.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index 874c51f99..52222cbbe 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -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); |