From 43b4f7ea5f96f861787c30fdd6933daf472fcc02 Mon Sep 17 00:00:00 2001 From: Boris Egorov Date: Tue, 5 Jan 2016 22:17:58 +0600 Subject: lib/tty: Pass default width to get_terminal_width() Almost any code calling get_terminal_width() checks returned width for non-positive values and sets it to some default value (say, 80). So, let's pass this default value directly to the function. [kzak@redhat.com: - get_terminal_width() refactoring] Signed-off-by: Karel Zak --- text-utils/column.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'text-utils/column.c') diff --git a/text-utils/column.c b/text-utils/column.c index 60d123123..4411d2d26 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -142,9 +142,7 @@ int main(int argc, char **argv) textdomain(PACKAGE); atexit(close_stdout); - termwidth = get_terminal_width(); - if (termwidth <= 0) - termwidth = 80; + termwidth = get_terminal_width(80); colsep = mbs_to_wcs(" "); while ((ch = getopt_long(argc, argv, "hVc:s:txo:", longopts, NULL)) != -1) -- cgit v1.2.3-55-g7522