diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-17 14:12:10 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-17 14:12:10 +0100 |
| commit | 7ff3c488f6e5c5f7384279daff0256b7ca988167 (patch) | |
| tree | 1a6459e76a9518aeda89c5b6be0dfe096ca5c062 | |
| parent | 2f522e306497a85c97fef585c276aa38064e9baf (diff) | |
| download | monitoring-plugins-7ff3c488f6e5c5f7384279daff0256b7ca988167.tar.gz | |
check_ide_smart: Fix positional arguments logic
| -rw-r--r-- | plugins/check_ide_smart.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c index b13c7101..dd88e124 100644 --- a/plugins/check_ide_smart.c +++ b/plugins/check_ide_smart.c | |||
| @@ -204,15 +204,17 @@ static check_ide_smart_config_wrapper process_arguments(int argc, char **argv) { | |||
| 204 | default: | 204 | default: |
| 205 | usage5(); | 205 | usage5(); |
| 206 | } | 206 | } |
| 207 | if (optind < argc) { | 207 | } |
| 208 | result.config.device = argv[optind]; | ||
| 209 | } | ||
| 210 | 208 | ||
| 211 | if (!result.config.device) { | 209 | if (optind < argc) { |
| 212 | print_help(); | 210 | result.config.device = argv[optind]; |
| 213 | exit(STATE_UNKNOWN); | 211 | } |
| 214 | } | 212 | |
| 213 | if (result.config.device == NULL) { | ||
| 214 | print_help(); | ||
| 215 | exit(STATE_UNKNOWN); | ||
| 215 | } | 216 | } |
| 217 | |||
| 216 | return result; | 218 | return result; |
| 217 | } | 219 | } |
| 218 | 220 | ||
