summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys-utils/setarch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index 76892ab4f..337f8fbaf 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -298,7 +298,7 @@ int main(int argc, char *argv[])
if (archwrapper)
arch = program_invocation_short_name; /* symlinks to setarch */
else {
- if (*argv[1] != '-') {
+ if (1 < argc && *argv[1] != '-') {
arch = argv[1];
argv[1] = argv[0]; /* for getopt_long() to get the program name */
argv++;