]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
util: Fix a signed/unsigned comparison
authorMartin Schwenke <martin@meltin.net>
Thu, 7 May 2020 07:14:34 +0000 (17:14 +1000)
committerVolker Lendecke <vl@samba.org>
Thu, 16 Jul 2020 04:00:52 +0000 (04:00 +0000)
[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 <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jul 16 04:00:52 UTC 2020 on sn-devel-184

lib/util/time.c

index 0fac5e2e39789b73d0a8a9f869d774b801a2c3bf..93e68dcf7248b88be4bc7061931868b712a4bd18 100644 (file)
@@ -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));