From 5aab494dd63e6cbbbb54fa0e362ae64e85dcadb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 22 Sep 2017 21:50:01 +0200 Subject: core, plugins: check return code of strftime function --- src/plugins/python/weechat-python-api.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/python/weechat-python-api.c') 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); -- cgit v1.2.3