aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/opendeco.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opendeco.c')
-rw-r--r--src/opendeco.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/opendeco.c b/src/opendeco.c
index fe9a1d1..04984a9 100644
--- a/src/opendeco.c
+++ b/src/opendeco.c
@@ -125,7 +125,11 @@ int parse_gasses(gas_t **gasses, char *str)
if (!gas_str)
break;
- scan_gas(&deco_gasses[gas_idx], gas_str);
+ if (scan_gas(&deco_gasses[gas_idx], gas_str)) {
+ wprintf(L"Invalid gas (%s). Aborting!\n", gas_str);
+ exit(-1);
+ }
+
gas_idx++;
}
@@ -175,7 +179,11 @@ int main(int argc, char *argv[])
double dec_per_min = xsw_to_bar(msw_or_fsw(9, 30));
gas_t bottom_gas;
- scan_gas(&bottom_gas, arguments.gas);
+
+ if (scan_gas(&bottom_gas, arguments.gas)) {
+ wprintf(L"Invalid gas (%s). Aborting!\n", arguments.gas);
+ exit(-1);
+ }
gas_t *deco_gasses;
int nof_gasses = parse_gasses(&deco_gasses, arguments.decogasses);