From ff09a5129af18e9d26ffe6dae90f2380d9a0f771 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 18 May 2019 22:36:44 +0100 Subject: sulogin: fix variable / function shadowing [cppcheck] [login-utils/sulogin.c:398] -> [login-utils/sulogin.c:171]: (style) Local variable set shadows outer function [login-utils/sulogin.c:398] -> [login-utils/sulogin.c:830]: (style) Local variable set shadows outer function Signed-off-by: Sami Kerola --- login-utils/sulogin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'login-utils') diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 549870d22..9091caf14 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -168,16 +168,17 @@ static void tcinit(struct console *con) tio->c_cc[VMIN] = 1; if (ioctl(fd, TIOCGWINSZ, &ws) == 0) { - int set = 0; + int update = 0; + if (ws.ws_row == 0) { ws.ws_row = 24; - set++; + update++; } if (ws.ws_col == 0) { ws.ws_col = 80; - set++; + update++; } - if (set) + if (update) ignore_result( ioctl(fd, TIOCSWINSZ, &ws) ); } -- cgit v1.2.3-55-g7522