s4-torture: Use the correct variable type in torture_smb2_maxfid()
authorAndreas Schneider <asn@samba.org>
Thu, 16 Feb 2017 16:07:54 +0000 (17:07 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Feb 2017 02:18:10 +0000 (03:18 +0100)
Found by covscan.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/smb2/maxfid.c

index cfdf7c17939d830e472e00f8281f8220c2035a06..dbe3fac9d397a84794ef575473854555f2182b1a 100644 (file)
@@ -32,7 +32,7 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
        NTSTATUS status;
        struct smb2_tree *tree = NULL;
        const char *dname = "smb2_maxfid";
-       int i, maxfid;
+       size_t i, maxfid;
        struct smb2_handle *handles,  dir_handle = { };
        size_t max_handles;
 
@@ -62,7 +62,7 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
                struct smb2_create create = { };
                struct smb2_close close = { };
 
-               name = talloc_asprintf(tctx, "%s\\%d", dname, i / 1000);
+               name = talloc_asprintf(tctx, "%s\\%zu", dname, i / 1000);
                torture_assert_goto(tctx, (name != NULL), ret, done,
                                    "no memory for directory name\n");
 
@@ -93,7 +93,7 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
                char *name;
                struct smb2_create create = { };
 
-               name = talloc_asprintf(tctx, "%s\\%d\\%d", dname, i / 1000, i);
+               name = talloc_asprintf(tctx, "%s\\%zu\\%zu", dname, i / 1000, i);
                torture_assert_goto(tctx, (name != NULL), ret, done,
                                    "no memory for file name\n");
 
@@ -120,7 +120,7 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
 
        maxfid = i;
        if (maxfid == max_handles) {
-               torture_comment(tctx, "Reached test limit of %d open files. "
+               torture_comment(tctx, "Reached test limit of %zu open files. "
                                "Adjust to higher test with "
                                "--option=torture:maxopenfiles=NNN\n", maxfid);
        }