From: Ruben Kerkhof Date: Thu, 31 May 2018 13:38:08 +0000 (+0200) Subject: utils_time.c: fix implicit conversion warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=aa53067971c6268e62532bf17082114e4606f92b;p=collectd.git utils_time.c: fix implicit conversion warning CC src/daemon/collectd-utils_time.o src/daemon/utils_time.c:153:14: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] if ((len = strftime(pos, size_left, "%Y-%m-%dT%H:%M:%S", t_tm)) == 0) ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/daemon/utils_time.c b/src/daemon/utils_time.c index 5c0f68e7..4637122e 100644 --- a/src/daemon/utils_time.c +++ b/src/daemon/utils_time.c @@ -146,7 +146,7 @@ static int format_zone(char *buffer, size_t buffer_size, int format_rfc3339(char *buffer, size_t buffer_size, struct tm const *t_tm, long nsec, bool print_nano, char const *zone) /* {{{ */ { - int len; + size_t len; char *pos = buffer; size_t size_left = buffer_size;