From 69d22a2297bc11b712661db1978d1ced7abcdfd4 Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Fri, 14 Oct 2022 17:47:13 +0200 Subject: 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. --- src/opendeco.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/opendeco.c') 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) { -- cgit v1.2.3-70-g09d2