From: Lennart Poettering Date: Sun, 17 Jan 2021 13:43:17 +0000 (+0100) Subject: systemctl: use right type 'size_t' for counting memory X-Git-Tag: v248-rc1~315 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ed7d3e6fdbb38443d72b7c28b05a9706a3c63b6;p=thirdparty%2Fsystemd.git systemctl: use right type 'size_t' for counting memory Follow-up for e363b0e4fc4f32225034a11dd53c0cc68747ba6e (Mostly a theoretical fix. On 64bit systems unsigned is 32bit, and we had more than 2^32 units thing would fall apart here.) --- diff --git a/src/systemctl/systemctl-list-units.c b/src/systemctl/systemctl-list-units.c index cf6ad4a95fe..7f0e79eedd6 100644 --- a/src/systemctl/systemctl-list-units.c +++ b/src/systemctl/systemctl-list-units.c @@ -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;