Fix a potential integer overflow
Because nr_files and new_size are not same types.It can cause new_size
less than zero.Then realloc will be failed.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/filesetup.c b/filesetup.c
index b1ca921..69eb37c 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -1074,7 +1074,7 @@
fio_file_reset(f);
if (td->files_size <= td->files_index) {
- int new_size = td->o.nr_files + 1;
+ unsigned int new_size = td->o.nr_files + 1;
dprint(FD_FILE, "resize file array to %d files\n", new_size);