From 9cd846ebef881192b2587dfc5d9f464d81e85beb Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 7 Aug 2023 16:34:02 +0200 Subject: [PATCH] Code quality improvements --- libs/draw.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/draw.c b/libs/draw.c index fa161fd..e6cb890 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -1,17 +1,18 @@ /* See LICENSE file for copyright and license details. */ -void drawhighlights(struct item *item, int x, int y, int w, int p, const char *ittext) { +void drawhighlights(struct item *item, int x, int y, int w, int p, char *itemtext) { int i, indent; char *highlight; char c; // limitation in order to prevent highlighting from drawing when the text isn't visible - if (columns > 5 && lines > 1) return; + if (columns > 5 && lines > 1) + return; - char *itemtext = strdup(ittext); + if (!(strlen(itemtext) && strlen(tx.text))) + return; - if (!(strlen(itemtext) && strlen(tx.text))) return; - - if (strstr(itemtext, "