Fix a bug where the program doesn't read the arguments
This commit is contained in:
parent
e94d16e7ea
commit
c564873ed9
@ -1,4 +1,4 @@
|
||||
#define _GNU_SOURCE // in order for strcasestr to work
|
||||
#define _GNU_SOURCE ///< in order for strcasestr to work
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@ -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;
|
||||
|
Reference in New Issue
Block a user