Changed variable c to be int as getopt() returns int (caused errors on my other machine).