diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index c3a9ba763d6..ea4ac63c44b 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -710,11 +710,7 @@ static void print_status_info( printf(" CGroup: %s\n", i->control_group); - c = columns(); - if (c > sizeof(prefix) - 1) - c -= sizeof(prefix) - 1; - else - c = 0; + c = LESS_BY(columns(), strlen(prefix)); r = unit_show_processes(bus, i->id, i->control_group, prefix, c, get_output_flags(), &error); if (r == -EBADR) { @@ -2097,11 +2093,7 @@ static int show_system_status(sd_bus *bus) { static const char prefix[] = " "; unsigned c; - c = columns(); - if (c > sizeof(prefix) - 1) - c -= sizeof(prefix) - 1; - else - c = 0; + c = LESS_BY(columns(), strlen(prefix)); show_cgroup(SYSTEMD_CGROUP_CONTROLLER, strempty(mi.control_group), prefix, c, get_output_flags()); }