From: Ondrej Zajicek Date: Wed, 20 Nov 2013 12:25:33 +0000 (+0100) Subject: Fixes some potential issues with invalid term size in clients. X-Git-Tag: v1.4.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d4979c67c65dceb1ae557707312b83fde4bc8a8;p=thirdparty%2Fbird.git Fixes some potential issues with invalid term size in clients. --- diff --git a/client/birdc.c b/client/birdc.c index 9dd6d9b9a..bbe18331b 100644 --- a/client/birdc.c +++ b/client/birdc.c @@ -148,8 +148,8 @@ input_init(void) rl_callback_handler_install("bird> ", input_got_line); // rl_get_screen_size(); - term_lns = LINES ? LINES : 25; - term_cls = COLS ? COLS : 80; + term_lns = LINES; + term_cls = COLS; prompt_active = 1; diff --git a/client/birdcl.c b/client/birdcl.c index c41b046c0..2d5e10678 100644 --- a/client/birdcl.c +++ b/client/birdcl.c @@ -150,11 +150,6 @@ input_init(void) term_lns = tws.ws_row; term_cls = tws.ws_col; } - else - { - term_lns = 25; - term_cls = 80; - } } void diff --git a/client/client.c b/client/client.c index 61caf38b0..a9d0096d9 100644 --- a/client/client.c +++ b/client/client.c @@ -178,6 +178,10 @@ init_commands(void) } input_init(); + + term_lns = (term_lns > 0) ? term_lns : 25; + term_cls = (term_cls > 0) ? term_cls : 80; + init = 0; }