@@ -1965,6 +1965,8 @@ print_clients_header(struct igt_drm_clients *clients, int lines,
int con_w, int con_h, int *class_w)
{
struct intel_clients *iclients = clients->private_data;
+ const int max_name_len = clients->max_name_len < 4 ?
+ 4 : clients->max_name_len; /* At least "NAME" */
if (output_mode == INTERACTIVE) {
unsigned int num_active = 0;
@@ -1988,9 +1990,8 @@ print_clients_header(struct igt_drm_clients *clients, int lines,
num_active++;
}
- *class_w = width =
- (con_w - len - clients->max_name_len - 1) /
- num_active;
+ *class_w = width = (con_w - len - max_name_len - 1) /
+ num_active;
for (i = 0; i <= iclients->classes.max_engine_id; i++) {
const char *name = iclients->classes.names[i];