From da0239382a25d05bd0c302c9c6c10ae82a7ebf18 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Tue, 18 Nov 2025 19:44:11 +0530 Subject: [PATCH] fish: Use size_t instead of int for iteration over an array Signed-off-by: Susant Sahani --- fish/copy.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fish/copy.c b/fish/copy.c index e701ebe95..becbb57d7 100644 --- a/fish/copy.c +++ b/fish/copy.c @@ -73,11 +73,10 @@ run_copy_out (const char *cmd, size_t argc, char *argv[]) /* Local directory is always the last arg. */ const char *local = argv[argc-1]; - const int nr_remotes = argc-1; + const size_t nr_remotes = argc-1; /* Download each remote one at a time using copy-out. */ - int i, r; - for (i = 0; i < nr_remotes; ++i) { + for (size_t i = 0; i < nr_remotes; ++i) { CLEANUP_FREE char *remote = NULL; /* Allow win:... prefix on remotes. */ @@ -85,7 +84,7 @@ run_copy_out (const char *cmd, size_t argc, char *argv[]) if (remote == NULL) return -1; - r = guestfs_copy_out (g, remote, local); + size_t r = guestfs_copy_out (g, remote, local); if (r == -1) return -1; }