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/relay/relay-buffer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/plugins/relay/relay-buffer.c') diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c index 5a0f8f87b..5d5d02632 100644 --- a/src/plugins/relay/relay-buffer.c +++ b/src/plugins/relay/relay-buffer.c @@ -96,8 +96,9 @@ relay_buffer_refresh (const char *hotlist) date_tmp = localtime (&(ptr_client->start_time)); if (date_tmp) { - strftime (str_date_start, sizeof (str_date_start), - "%a, %d %b %Y %H:%M:%S", date_tmp); + if (strftime (str_date_start, sizeof (str_date_start), + "%a, %d %b %Y %H:%M:%S", date_tmp) == 0) + str_date_start[0] = '\0'; } str_date_end[0] = '-'; str_date_end[1] = '\0'; @@ -106,8 +107,9 @@ relay_buffer_refresh (const char *hotlist) date_tmp = localtime (&(ptr_client->end_time)); if (date_tmp) { - strftime (str_date_end, sizeof (str_date_end), - "%a, %d %b %Y %H:%M:%S", date_tmp); + if (strftime (str_date_end, sizeof (str_date_end), + "%a, %d %b %Y %H:%M:%S", date_tmp) == 0) + str_date_end[0] = '\0'; } } -- cgit v1.2.3