systemctl: use right type 'size_t' for counting memory

Follow-up for e363b0e4fc

(Mostly a theoretical fix. On 64bit systems unsigned is 32bit, and we
had more than 2^32 units thing would fall apart here.)
This commit is contained in:
Lennart Poettering
2021-01-18 01:17:27 +09:00
committed by Yu Watanabe
parent 5a3e1cb918
commit 7ed7d3e6fd
+1 -1
View File
@@ -109,7 +109,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
(void) table_set_empty_string(table, "-");
for (const UnitInfo *u = unit_infos; unit_infos && (unsigned)(u - unit_infos) < c; u++) {
for (const UnitInfo *u = unit_infos; unit_infos && (size_t) (u - unit_infos) < c; u++) {
_cleanup_free_ char *j = NULL;
const char *on_underline = "", *on_loaded = "", *on_active = "";
const char *on_circle = "", *id;