summaryrefslogtreecommitdiffstats
path: root/lib/ttyutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ttyutils.c')
-rw-r--r--lib/ttyutils.c16
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;
}