summaryrefslogtreecommitdiff
path: root/src/plugins/tcl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tcl')
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 28675b21e..aeffc60bc 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -4839,7 +4839,10 @@ API_FUNC(infolist_time)
time = weechat_infolist_time (API_STR2PTR(infolist), 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);