diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2021-02-09 23:49:31 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-02-09 23:49:31 +0100 |
commit | ea114447ee44908c75f4ddc19a0521260832668d (patch) | |
tree | 4a625fb1a500884c9995e9699725694a29f6da12 | |
parent | 6284c8221da94ab6b4262795e6a7990fc3655848 (diff) |
Adjust loops to use size_t instead of int
Gbp-Dch: ignore
-rw-r--r-- | test/interactive-helper/createdeb-cve-2020-27350.cc | 6 |
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)); } |