diff --git a/mygrep/mygrep.c b/mygrep/mygrep.c index 0fadde9abe5650a77eb2fe887140b4b34eb3a688..4283678b5a74cbf49e5b90d60b519d71d0bf3936 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;