Replace exit() with simple return;

This commit is contained in:
Alexander Andreev 2024-05-19 05:21:35 +04:00
parent 62a16292ec
commit a469ae41a2
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -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);