diff --git a/mygrep/mygrep.c b/mygrep/mygrep.c index 0fadde9..4283678 100644 --- a/mygrep/mygrep.c +++ b/mygrep/mygrep.c @@ -1,4 +1,4 @@ -#define _GNU_SOURCE // in order for strcasestr to work +#define _GNU_SOURCE ///< in order for strcasestr to work #include #include #include @@ -15,10 +15,10 @@ int main(int argc, char *argv[]) { char *ofile = NULL; char *keyword = NULL; char *filename = NULL; - int c = getopt(argc, argv, "io:h"); ///< Get the options + int c; /// Process the options - while(c != -1) { + while((c = getopt(argc, argv, "io:h")) != -1) { switch(c) { case 'i': iflag = 1;