diff --git a/otp.c b/otp.c index 0fe4480..3e7748d 100644 --- a/otp.c +++ b/otp.c @@ -158,6 +158,7 @@ int interactive_mode(void) { handle_pads_menu(); break; case 'X': + case 'Q': printf("Goodbye!\n"); return 0; default: @@ -3045,10 +3046,15 @@ int handle_pads_menu(void) { char input[10]; if (fgets(input, sizeof(input), stdin)) { - char choice = toupper(input[0]); - if (choice == 'G') { - return handle_generate_menu(); + char choice = toupper(input[0]); + if (choice == 'G') { + int result = handle_generate_menu(); + if (result == 0) { + // After successful pad generation, return to pads menu + return handle_pads_menu(); } + return result; + } } return 0; } @@ -3117,7 +3123,12 @@ int handle_pads_menu(void) { // Handle actions first if (toupper(input[0]) == 'G') { - return handle_generate_menu(); + int result = handle_generate_menu(); + if (result == 0) { + // After successful pad generation, return to pads menu + return handle_pads_menu(); + } + return result; } else if (toupper(input[0]) == 'B') { return 0; // Back to main menu }