]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/canonicalize: fix compiler warning [-Wsign-compare]
authorKarel Zak <kzak@redhat.com>
Mon, 10 Jun 2019 09:00:38 +0000 (11:00 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Jun 2019 09:00:38 +0000 (11:00 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/canonicalize.c

index e8d170c867127498744e776cb33c0cf07ca51287..e101c5b7a8af6af57f52d10562280cc2e221ccc8 100644 (file)
@@ -186,7 +186,8 @@ char *canonicalize_path_restricted(const char *path)
                        }
                }
 
-               len = canonical ? strlen(canonical) : errno ? -errno : -EINVAL;
+               len = canonical ? (ssize_t) strlen(canonical) :
+                         errno ? -errno : -EINVAL;
 
                /* send length or errno */
                write_all(pipes[1], (char *) &len, sizeof(len));