forked from Mirrors/sngrep
capture: Use default device if no device or input file has been specified
This commit is contained in:
parent
be708634c1
commit
25ce3f65e6
11
src/main.c
11
src/main.c
|
@ -323,6 +323,11 @@ main(int argc, char* argv[])
|
|||
capture_eep_init();
|
||||
#endif
|
||||
|
||||
// If no device or files has been specified in command line, use default
|
||||
if (vector_count(indevices) == 0 && vector_count(infiles) == 0) {
|
||||
vector_append(indevices, (char *) device);
|
||||
}
|
||||
|
||||
// If we have an input file, load it
|
||||
for (i = 0; i < vector_count(infiles); i++) {
|
||||
// Try to load file
|
||||
|
@ -337,12 +342,6 @@ main(int argc, char* argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
// If no device or files has been specified in command line, use default
|
||||
if (vector_count(indevices) == 0 && vector_count(infiles) == 0) {
|
||||
vector_append(indevices, (char *) device);
|
||||
}
|
||||
|
||||
|
||||
// Remove Input files vector
|
||||
vector_destroy(infiles);
|
||||
|
||||
|
|
Loading…
Reference in New Issue