summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-10-02 16:03:32 +0100
committerTom Hacohen <tom@stosb.com>2013-10-02 16:04:40 +0100
commitea01e1feff833c67442e20c6afa21e202a48d7f8 (patch)
treee5a098dd118ec137c7fe65fffcce4b268f3aeb62
parent6ea84b2a7645fb01d5516b7cda8770564d7aec60 (diff)
Make the argument count start from 1, not 0 - better for normal users.
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 7efd6cc..3e425a0 100644
--- a/main.c
+++ b/main.c
@@ -7,7 +7,7 @@ main(int argc, char *argv[])
7 unsigned int argument = 0; 7 unsigned int argument = 0;
8 8
9 if (argc >= 2) 9 if (argc >= 2)
10 argument = atoi(argv[1]); 10 argument = atoi(argv[1]) - 1;
11 11
12 if (argument < (unsigned) argc) 12 if (argument < (unsigned) argc)
13 printf("arg %d: %s\n", argument, argv[argument]); 13 printf("arg %d: %s\n", argument, argv[argument]);