capture: Use default device if no device or input file has been specified

This commit is contained in:
Kaian 2017-04-04 11:14:26 +02:00
parent be708634c1
commit 25ce3f65e6
1 changed files with 5 additions and 6 deletions

View File

@ -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);