aboutsummaryrefslogtreecommitdiff
path: root/loginutils/su.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils/su.c')
-rw-r--r--loginutils/su.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/loginutils/su.c b/loginutils/su.c
index afb9843f8..1a35f0e4f 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -12,7 +12,7 @@
#define SU_OPT_l (4)
int su_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int su_main(int argc, char **argv)
+int su_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
unsigned flags;
char *opt_shell = NULL;
@@ -24,19 +24,17 @@ int su_main(int argc, char **argv)
char *old_user;
flags = getopt32(argv, "mplc:s:", &opt_command, &opt_shell);
- argc -= optind;
+ //argc -= optind;
argv += optind;
- if (argc && LONE_DASH(argv[0])) {
+ if (argv[0] && LONE_DASH(argv[0])) {
flags |= SU_OPT_l;
- argc--;
argv++;
}
/* get user if specified */
- if (argc) {
+ if (argv[0]) {
opt_username = argv[0];
- //argc--; - not used below anyway
argv++;
}