aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2022-10-14 17:47:13 +0200
committerGravatar Tim Segers <tsegers@pm.me>2022-10-14 17:47:13 +0200
commit69d22a2297bc11b712661db1978d1ced7abcdfd4 (patch)
tree3f9adc04e8965a0d2dd081b26b70391a3834907e
parent06e9e0d0df237e3d505d908ccf264091b440e066 (diff)
downloadopendeco-69d22a2297bc11b712661db1978d1ced7abcdfd4.tar.gz
Reject invalid number for surface air pressure
Filling in a non-number argument for surface pressure sets the value to 0. This value is now rejected.
-rw-r--r--src/opendeco.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/opendeco.c b/src/opendeco.c
index 5051633..fa31757 100644
--- a/src/opendeco.c
+++ b/src/opendeco.c
@@ -93,9 +93,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
argp_failure(state, 1, 0, "Options -d and -t are required. See --help for more information");
exit(ARGP_ERR_UNKNOWN);
}
- if (arguments->SURFACE_PRESSURE < 0) {
- argp_state_help(state, stderr, ARGP_HELP_USAGE);
- argp_failure(state, 1, 0, "Surface air pressure must be positive. See --help for more information");
+ if (arguments->SURFACE_PRESSURE <= 0) {
+ argp_failure(state, 1, 0, "Surface air pressure must be positive");
exit(ARGP_ERR_UNKNOWN);
}
if (arguments->gflow > arguments->gfhigh) {