Fixes for VS2019, and the use of a different compiler.

This commit is contained in:
Jonathan Naylor
2024-05-30 14:53:55 +01:00
parent e12b2b9994
commit d9e2f52ae6
5 changed files with 34 additions and 35 deletions

View File

@@ -52,12 +52,15 @@ REMOTE_COMMAND CRemoteControl::getCommand(const std::string& command)
std::string reply = "OK";
std::stringstream tokeniser(command);
// Parse the original command into a vector of strings.
std::string token;
while (std::getline(tokeniser, token, ' '))
m_args.push_back(token);
size_t start = command.find_first_not_of(' ');
while (start != std::string::npos) {
size_t end = command.find_first_of(' ', start);
m_args.push_back(command.substr(start, end - start));
start = command.find_first_not_of(' ', end);
}
if (m_args.at(0U) == "mode" && m_args.size() >= SET_MODE_ARGS) {
// Mode command is in the form of "mode <mode> [<timeout>|fixed]"