src/sulogin.c: Remove 'static' from local variable, but keep initialization

We don't need 'static', because it's in main(), which is only called
once.  However, we will need initialization as if it were 'static', so
use ={} to initialize it.  This will allow freeing the pointers before
they have been allocated.

Cc: Samanta Navarro <ferivoz@riseup.net>
Suggested-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-01-17 17:08:50 +01:00
committed by Serge Hallyn
parent 4edda5d8ba
commit 08ae7af111

View File

@@ -55,17 +55,19 @@ static void catch_signals (unused int sig)
_exit (1);
}
/*ARGSUSED*/ int main (int argc, char **argv)
/*ARGSUSED*/ int
main(int argc, char **argv)
{
int err = 0;
char pass[BUFSIZ];
char **envp = environ;
TERMIO termio;
struct passwd pwent = {};
#ifndef USE_PAM
const char *env;
#endif
static struct passwd pwent;
tcgetattr (0, &termio);
termio.c_iflag |= (ICRNL | IXON);