Commit c564873e authored by Ivaylo Ivanov's avatar Ivaylo Ivanov

Fix a bug where the program doesn't read the arguments

parent e94d16e7
#define _GNU_SOURCE // in order for strcasestr to work #define _GNU_SOURCE ///< in order for strcasestr to work
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
...@@ -15,10 +15,10 @@ int main(int argc, char *argv[]) { ...@@ -15,10 +15,10 @@ int main(int argc, char *argv[]) {
char *ofile = NULL; char *ofile = NULL;
char *keyword = NULL; char *keyword = NULL;
char *filename = NULL; char *filename = NULL;
int c = getopt(argc, argv, "io:h"); ///< Get the options int c;
/// Process the options /// Process the options
while(c != -1) { while((c = getopt(argc, argv, "io:h")) != -1) {
switch(c) { switch(c) {
case 'i': case 'i':
iflag = 1; iflag = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment