switches if branch to a switch

This commit is contained in:
SuperNovaa41 2024-01-31 11:59:56 -05:00
parent e449bdd2c5
commit d703a32c2d

View File

@ -27,10 +27,16 @@ void do_db_entry(enum DB_OPTIONS option, ...)
setup_db(db);
va_start(args, option);
if (ADD == option) {
switch(option) {
case ADD:
add_to_db(va_arg(args, book_t*), db);
} else if (REMOVE == option) {
break;
case REMOVE:
remove_from_db(va_arg(args, int), db);
break;
default:
fprintf(stderr, "Invalid db command given!\n");
break;
}
va_end(args);