1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

maint: logname: reduce variable scope

* src/logname.c (main): Declare variables where they are used instead of
at the start of the function.
This commit is contained in:
Collin Funk
2025-12-07 14:59:19 -08:00
parent 597dfa0d31
commit efd9a48ca5

View File

@@ -49,8 +49,6 @@ Print the user's login name.\n\
int
main (int argc, char **argv)
{
char *cp;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
setlocale (LC_ALL, "");
@@ -71,7 +69,7 @@ main (int argc, char **argv)
/* POSIX requires using getlogin (or equivalent code) and prohibits
using a fallback technique. */
cp = getlogin ();
char const *cp = getlogin ();
if (! cp)
error (EXIT_FAILURE, 0, _("no login name"));