From ff455b0004080a260a63f12ca8bf7c148eab6ee7 Mon Sep 17 00:00:00 2001 From: ryenus Date: Sat, 3 Oct 2020 00:12:31 +0800 Subject: limit max screen title length to window width Applies screen title truncating to all InfoScreen classes. --- CommandScreen.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'CommandScreen.c') diff --git a/CommandScreen.c b/CommandScreen.c index d8e709c4..bc71e09f 100644 --- a/CommandScreen.c +++ b/CommandScreen.c @@ -45,14 +45,7 @@ static void CommandScreen_scan(InfoScreen* this) { } static void CommandScreen_draw(InfoScreen* this) { - char* title = xMalloc(COLS + 1); - int len = snprintf(title, COLS + 1, "Command of process %d - %s", this->process->pid, this->process->comm); - if (len > COLS) { - memset(&title[COLS - 3], '.', 3); - } - - InfoScreen_drawTitled(this, "%s", title); - free(title); + InfoScreen_drawTitled(this, "Command of process %d - %s", this->process->pid, this->process->comm); } InfoScreenClass CommandScreen_class = { -- cgit v1.2.3