]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: fix variable / function shadowing [cppcheck]
authorSami Kerola <kerolasa@iki.fi>
Sat, 18 May 2019 21:36:44 +0000 (22:36 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 18 May 2019 21:41:58 +0000 (22:41 +0100)
[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>
login-utils/sulogin.c

index 549870d224418ea2e0958953a4b4ed84b42dde19..9091caf14ff23dd63d47647974a9b76463463f59 100644 (file)
@@ -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) );
                }