mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
check_ide_smart: Fix positional arguments logic
This commit is contained in:
parent
2f522e3064
commit
7ff3c488f6
1 changed files with 10 additions and 8 deletions
|
|
@ -204,15 +204,17 @@ static check_ide_smart_config_wrapper process_arguments(int argc, char **argv) {
|
|||
default:
|
||||
usage5();
|
||||
}
|
||||
if (optind < argc) {
|
||||
result.config.device = argv[optind];
|
||||
}
|
||||
|
||||
if (!result.config.device) {
|
||||
print_help();
|
||||
exit(STATE_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc) {
|
||||
result.config.device = argv[optind];
|
||||
}
|
||||
|
||||
if (result.config.device == NULL) {
|
||||
print_help();
|
||||
exit(STATE_UNKNOWN);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue