treewide: tighten variable scope in loops (#18372)
Also use _cleanup_free_ in one more place.
This commit is contained in:
@@ -43,7 +43,7 @@ char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
|
||||
{ "K", UINT64_C(1000) },
|
||||
};
|
||||
const suffix_table *table;
|
||||
size_t n, i;
|
||||
size_t n;
|
||||
|
||||
assert_cc(ELEMENTSOF(table_iec) == ELEMENTSOF(table_si));
|
||||
|
||||
@@ -53,7 +53,7 @@ char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
|
||||
table = flag & FORMAT_BYTES_USE_IEC ? table_iec : table_si;
|
||||
n = ELEMENTSOF(table_iec);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
for (size_t i = 0; i < n; i++)
|
||||
if (t >= table[i].factor) {
|
||||
if (flag & FORMAT_BYTES_BELOW_POINT) {
|
||||
snprintf(buf, l,
|
||||
|
||||
Reference in New Issue
Block a user