From d02122b922b107a6e9d7c39cfa18175631809fa3 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 22 Jan 2019 14:38:06 +0000 Subject: [PATCH] Fix bug in use of std::vector size, thanks to Flo DF2ET. --- RemoteControl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RemoteControl.cpp b/RemoteControl.cpp index e59ab07..e90e159 100644 --- a/RemoteControl.cpp +++ b/RemoteControl.cpp @@ -69,8 +69,8 @@ REMOTE_COMMAND CRemoteControl::getCommand() m_args.push_back(std::string(p)); } - if (m_args.at(0U) == "mode" && m_args.length() >= SET_MODE_ARGS) { - // Mode command is in the form of "mode [timeout]" + if (m_args.at(0U) == "mode" && m_args.size() >= SET_MODE_ARGS) { + // Mode command is in the form of "mode [|fixed]" if (m_args.at(1U) == "idle") m_command = RCD_MODE_IDLE; else if (m_args.at(1U) == "lockout") @@ -108,7 +108,7 @@ unsigned int CRemoteControl::getArgCount() const case RCD_MODE_YSF: case RCD_MODE_P25: case RCD_MODE_NXDN: - return m_args.length() - SET_MODE_ARGS; + return m_args.size() - SET_MODE_ARGS; default: return 0U; } @@ -130,7 +130,7 @@ std::string CRemoteControl::getArgString(unsigned int n) const return ""; } - if (n >= m_args.length()) + if (n >= m_args.size()) return ""; return m_args.at(n);