]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: fix ambiguous ‘else’ [-Werror=dangling-else]
authorKarel Zak <kzak@redhat.com>
Wed, 24 Jul 2024 07:13:08 +0000 (09:13 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 24 Jul 2024 07:13:08 +0000 (09:13 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c

index 500e0992fdf2d8ef07354de06346ec24557676c2..7a1da5ee5e4d77f514dc5395a4d5aaeb80f83c17 100644 (file)
@@ -2288,7 +2288,7 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
                        default:
                                if ((size_t)(bp - logname) >= sizeof(logname) - 1)
                                        log_err(_("%s: input overrun"), op->tty);
-                               if ((tp->c_lflag & ECHO) == 0)
+                               if ((tp->c_lflag & ECHO) == 0) {
                                        /* Visualize escape sequence instead of its execution */
                                        if (ascval == CTL('['))
                                                /* Ideally it should be "\xe2\x90\x9b"
@@ -2297,6 +2297,7 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
                                                write_all(1, "^[", 2);
                                        else
                                                write_all(1, &c, 1);    /* echo the character */
+                               }
                                *bp++ = ascval;                 /* and store it */
                                break;
                        }