Update main.c

Bugfix regarding to getopt..