summaryrefslogtreecommitdiffstats
path: root/CommandScreen.c
diff options
context:
space:
mode:
authorryenus <ryenus@gmail.com>2020-10-03 00:12:31 +0800
committercgzones <cgzones@googlemail.com>2020-10-05 12:18:05 +0200
commitff455b0004080a260a63f12ca8bf7c148eab6ee7 (patch)
tree74816461597e0b2c11a0812dbca83b0dfda2215c /CommandScreen.c
parent72613a38f40840df99955d555c9bd5d53368e52e (diff)
limit max screen title length to window width
Applies screen title truncating to all InfoScreen classes.
Diffstat (limited to 'CommandScreen.c')
-rw-r--r--CommandScreen.c9
1 files changed, 1 insertions, 8 deletions
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 = {

© 2014-2024 Faster IT GmbH | imprint | privacy policy