Skip to content

Commit

Permalink
Clear the read queue once string is pulled off of it
Browse files Browse the repository at this point in the history
  • Loading branch information
Tails86 committed Jan 28, 2025
1 parent 6f4c56e commit 9ada2a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/sdl/dreamconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ class DreamcastControllerUsbPicoConnection : public DreamcastControllerConnectio
}

// discard the first message as we are interested in the second only which returns the controller configuration
response = read_queue.back();
response = std::move(read_queue.back());
read_queue.clear();

sscanf(response.c_str(), "%hhx %hhx %hhx %hhx", &msg.command, &msg.destAP, &msg.originAP, &msg.size);

Expand Down

0 comments on commit 9ada2a3

Please sign in to comment.