summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorSami Kerola2019-05-18 23:36:44 +0200
committerSami Kerola2019-05-18 23:41:58 +0200
commitff09a5129af18e9d26ffe6dae90f2380d9a0f771 (patch)
tree6f896b12cf3e6c8217fa4aadbe599bc714bc240e /login-utils
parentlscpu: remove redundant condition check [cppcheck] (diff)
downloadkernel-qcow2-util-linux-ff09a5129af18e9d26ffe6dae90f2380d9a0f771.tar.gz
kernel-qcow2-util-linux-ff09a5129af18e9d26ffe6dae90f2380d9a0f771.tar.xz
kernel-qcow2-util-linux-ff09a5129af18e9d26ffe6dae90f2380d9a0f771.zip
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 <kerolasa@iki.fi>
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/sulogin.c9
1 files changed, 5 insertions, 4 deletions
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) );
}