summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSami Kerola2019-05-18 23:56:15 +0200
committerSami Kerola2019-05-18 23:56:15 +0200
commitcc7ffe129d7c01eb3d4bf650e70b6befef6e1e19 (patch)
tree612a0bd0978d4b0ba0cd25fc4dbacb95869e0157 /lib
parentwipefs: fix variable / function shadowing [cppcheck] (diff)
downloadkernel-qcow2-util-linux-cc7ffe129d7c01eb3d4bf650e70b6befef6e1e19.tar.gz
kernel-qcow2-util-linux-cc7ffe129d7c01eb3d4bf650e70b6befef6e1e19.tar.xz
kernel-qcow2-util-linux-cc7ffe129d7c01eb3d4bf650e70b6befef6e1e19.zip
lib/colors: remove redundant if statement
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'lib')
-rw-r--r--lib/colors.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/colors.c b/lib/colors.c
index ecec0ac30..26f3c81f7 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -662,11 +662,9 @@ static int colors_terminal_is_ready(void)
if (setupterm(NULL, STDOUT_FILENO, &ret) != 0 || ret != 1)
goto none;
ncolors = tigetnum("colors");
- if (ncolors <= 2)
- goto none;
}
#endif
- if (ncolors != -1) {
+ if (1 < ncolors) {
DBG(CONF, ul_debug("terminal is ready (supports %d colors)", ncolors));
return 1;
}