From bd5b4a16c7e45b4deafb9071d915b90740d45543 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 23 Apr 2019 12:57:02 +0200 Subject: [PATCH] s3:modules: Fix size types error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme --- source3/modules/vfs_glusterfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 82a7c2ce9b4..ba8973fa6d3 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -161,8 +161,8 @@ static int vfs_gluster_set_volfile_servers(glfs_t *fs, const char *volfile_servers) { char *server = NULL; - int server_count = 0; - int server_success = 0; + size_t server_count = 0; + size_t server_success = 0; int ret = -1; TALLOC_CTX *frame = talloc_stackframe(); @@ -174,7 +174,7 @@ static int vfs_gluster_set_volfile_servers(glfs_t *fs, int port = 0; server_count++; - DBG_INFO("server %d %s\n", server_count, server); + DBG_INFO("server %zu %s\n", server_count, server); /* Determine the transport type */ if (strncmp(server, "unix+", 5) == 0) { @@ -251,7 +251,7 @@ out: if (server_count == 0) { ret = -1; } else if (server_success < server_count) { - DBG_WARNING("Failed to set %d out of %d servers parsed\n", + DBG_WARNING("Failed to set %zu out of %zu servers parsed\n", server_count - server_success, server_count); ret = 0; }