From eeeb228664d37d890ce9962a6e5eb2fbda5afcfc Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sat, 31 Aug 2019 16:35:19 +0100 Subject: [PATCH] cap_server_time: Fix strftime return value check --- modules/cap_server_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cap_server_time.c b/modules/cap_server_time.c index 7371279d..40d75d77 100644 --- a/modules/cap_server_time.c +++ b/modules/cap_server_time.c @@ -57,7 +57,7 @@ cap_server_time_process(hook_data *data) struct timeval tv; if (!rb_gettimeofday(&tv, NULL)) { - if (strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S.", gmtime(&tv.tv_sec)) < 0) + if (strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S.", gmtime(&tv.tv_sec)) == 0) return; if (rb_snprintf_append(buf, sizeof(buf), "%03uZ", (int)tv.tv_usec / 1000) < 0)