]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/login.c: Remove dead code
authorAlejandro Colomar <alx@kernel.org>
Mon, 13 May 2024 12:31:01 +0000 (14:31 +0200)
committerSerge Hallyn <serge@hallyn.com>
Tue, 2 Jul 2024 02:40:11 +0000 (21:40 -0500)
The functions that set these strings --do_rlogin() and login_prompt()--
make sure to terminate them with a NUL.

Fixes: 3704745289f5 ("* lib/defines.h: Define USER_NAME_MAX_LENGTH, based on utmp and [...]")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/login.c

index cdfa132941a394e186319f58246397dc13b12d35..f9f8606fb8647a38b0ddd4e0774de2e6a746f375 100644 (file)
@@ -834,7 +834,6 @@ int main (int argc, char **argv)
                        }
                        preauth_flag = false;
                        username = XMALLOC(max_size, char);
-                       username[max_size - 1] = '\0';
                        login_prompt(username, max_size);
 
                        if ('\0' == username[0]) {