Replace exit() with simple return;
This commit is contained in:
parent
62a16292ec
commit
a469ae41a2
@ -23,10 +23,10 @@ int main(const int argc, const char *const *const argv) {
|
||||
interval_t interval = 0;
|
||||
|
||||
switch (parse_arguments(argc, argv, &price, &wattage, &interval)) {
|
||||
case 1: print_usage(); exit(0);
|
||||
case 2: print_version(); exit(0);
|
||||
case 99: fputs("Unknown flag provided.\n", stderr); print_usage(); exit(1);
|
||||
}
|
||||
case 1: print_usage(); return 0;
|
||||
case 2: print_version(); return 0;
|
||||
case 99: fputs("Unknown flag provided.\n", stderr); print_usage(); return 1;
|
||||
}
|
||||
|
||||
printf("%.2Lf\n", (price * wattage) * interval);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user