summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2021-02-09 23:49:31 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2021-02-09 23:49:31 +0100
commitea114447ee44908c75f4ddc19a0521260832668d (patch)
tree4a625fb1a500884c9995e9699725694a29f6da12
parent6284c8221da94ab6b4262795e6a7990fc3655848 (diff)
Adjust loops to use size_t instead of int
Gbp-Dch: ignore
-rw-r--r--test/interactive-helper/createdeb-cve-2020-27350.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/interactive-helper/createdeb-cve-2020-27350.cc b/test/interactive-helper/createdeb-cve-2020-27350.cc
index a290c0ac2..7fc9b0e55 100644
--- a/test/interactive-helper/createdeb-cve-2020-27350.cc
+++ b/test/interactive-helper/createdeb-cve-2020-27350.cc
@@ -231,7 +231,7 @@ static void createtar(const int fd)
struct TarHeader t;
char buf[512];
} t;
- for (int i = 0; i < sizeof(t.buf); i++)
+ for (size_t i = 0; i < sizeof(t.buf); i++)
t.buf[i] = '7';
memcpy(t.t.Name, "unterminatedName", 16);
memcpy(t.t.UserName, "userName", 8);
@@ -247,11 +247,11 @@ static void createtar(const int fd)
memset(t.t.Checksum, ' ', sizeof(t.t.Checksum));
unsigned long sum = 0;
- for (int i = 0; i < sizeof(t.buf); i++)
+ for (size_t i = 0; i < sizeof(t.buf); i++)
sum += t.buf[i];
int written = sprintf(t.t.Checksum, "%lo", sum);
- for (int i = written; i < sizeof(t.t.Checksum); i++)
+ for (size_t i = written; i < sizeof(t.t.Checksum); i++)
t.t.Checksum[i] = ' ';
write_chk(fd, t.buf, sizeof(t.buf));
}