s4:ntvfs: Fix size type in pvfs functions
authorAndreas Schneider <asn@samba.org>
Thu, 7 Dec 2017 16:35:11 +0000 (17:35 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 20 Mar 2018 22:16:14 +0000 (23:16 +0100)
This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/ntvfs/posix/pvfs_resolve.c

index 12fc0c1110b3bdc5a2d96efc3e7fe65e198d6b45..cc3d72c2ed662983c9f43402ad916d9cea2a9639 100644 (file)
@@ -62,10 +62,10 @@ static NTSTATUS pvfs_case_search(struct pvfs_state *pvfs,
                                 unsigned int flags)
 {
        /* break into a series of components */
-       int num_components;
+       size_t num_components;
        char **components;
        char *p, *partial_name;
-       int i;
+       size_t i;
 
        /* break up the full name info pathname components */
        num_components=2;
@@ -389,7 +389,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
 {
        codepoint_t c;
        size_t c_size, len;
-       int i, num_components, err_count;
+       size_t i, num_components, err_count;
        char **components;
        char *p, *s, *ret;
 
@@ -432,7 +432,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx,
                        err_count++;
                }
        }
-       if (err_count) {
+       if (err_count > 0) {
                if (flags & PVFS_RESOLVE_WILDCARD) err_count--;
 
                if (err_count==1) {