From: Martin Schwenke Date: Thu, 7 May 2020 07:14:34 +0000 (+1000) Subject: util: Fix a signed/unsigned comparison X-Git-Tag: talloc-2.3.2~1106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8f1d267cde21b75dd8652a0d5c98cf0890e1996;p=thirdparty%2Fsamba.git util: Fix a signed/unsigned comparison [107/390] Compiling lib/util/time.c ../../../lib/util/time.c: In function ‘timespec_string_buf’: ../../../lib/util/time.c:416:10: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 416 | if (len == -1) { | ^~ Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Thu Jul 16 04:00:52 UTC 2020 on sn-devel-184 --- diff --git a/lib/util/time.c b/lib/util/time.c index 0fac5e2e397..93e68dcf724 100644 --- a/lib/util/time.c +++ b/lib/util/time.c @@ -374,7 +374,7 @@ const char *timespec_string_buf(const struct timespec *tp, { time_t t; struct tm *tm = NULL; - size_t len; + int len; if (is_omit_timespec(tp)) { strlcpy(buf->buf, "SAMBA_UTIME_OMIT", sizeof(buf->buf));