diff options
author | Karel Zak | 2019-07-15 11:37:17 +0200 |
---|---|---|
committer | Karel Zak | 2019-07-15 11:37:17 +0200 |
commit | 6744302ce5b23ef19d7cfaa20cb53d27642ea8ac (patch) | |
tree | cf0b984c0ecc6b52e39caf2e39d7f4cc6f9b252a /lib/ttyutils.c | |
parent | build-sys: Include <stdlib.h> in ./configure wchar_t test (diff) | |
parent | libblkid: fix address sanitizer issues (diff) | |
download | kernel-qcow2-util-linux-6744302ce5b23ef19d7cfaa20cb53d27642ea8ac.tar.gz kernel-qcow2-util-linux-6744302ce5b23ef19d7cfaa20cb53d27642ea8ac.tar.xz kernel-qcow2-util-linux-6744302ce5b23ef19d7cfaa20cb53d27642ea8ac.zip |
Merge branch '2019wk27' of https://github.com/kerolasa/util-linux
* '2019wk27' of https://github.com/kerolasa/util-linux:
libblkid: fix address sanitizer issues
libblkid: check number of test_blkid_save arguments correctly
include/xalloc: ensure xstrdup() and xstrndup() returns nonnull attribute
libmount: fix potential null pointer dereference
libfdisk: fix variable shadowing
lib/ttyutils: avoid checking same thing twice
Diffstat (limited to 'lib/ttyutils.c')
-rw-r--r-- | lib/ttyutils.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ttyutils.c b/lib/ttyutils.c index 166e49e11..8649f435a 100644 --- a/lib/ttyutils.c +++ b/lib/ttyutils.c @@ -47,16 +47,16 @@ int get_terminal_dimension(int *cols, int *lines) l = t_win.ts_lines; } #endif - - if (cols && c <= 0) - c = get_env_int("COLUMNS"); - if (lines && l <= 0) - l = get_env_int("LINES"); - - if (cols) + if (cols) { + if (c <= 0) + c = get_env_int("COLUMNS"); *cols = c; - if (lines) + } + if (lines) { + if (l <= 0) + l = get_env_int("LINES"); *lines = l; + } return 0; } |