Skip to content

Commit

Permalink
fix: select tasks skipping input after std::cin
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Nov 19, 2023
1 parent 4757b29 commit 7ca3a30
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ bool select_server(int& server)
<< std::endl
<< "Please enter the server number: " << std::endl;

std::cin.sync();
std::cin >> server;

if (server < 1 || server > 3) {
Expand Down Expand Up @@ -233,7 +232,6 @@ bool select_device_index(const MaaSize& device_size, MaaSize& index)
print_device_list(device_size);
std::cout << std::endl << "Please enter the device number:" << std::endl;

std::cin.sync();
std::cin >> index;

if (index > device_size) {
Expand Down Expand Up @@ -278,7 +276,7 @@ bool select_tasks(std::vector<Task>& tasklist)
std::vector<int> task_ids;
std::string line;

std::cin.sync();
std::cin.ignore();
std::getline(std::cin, line);

std::istringstream iss(line);
Expand Down

0 comments on commit 7ca3a30

Please sign in to comment.