From: Sami Kerola Date: Sat, 18 May 2019 21:36:44 +0000 (+0100) Subject: sulogin: fix variable / function shadowing [cppcheck] X-Git-Tag: v2.34-rc2~51^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff09a5129af18e9d26ffe6dae90f2380d9a0f771;p=thirdparty%2Futil-linux.git 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 --- diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 549870d224..9091caf14f 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) ); }