From b2db94675b1881ab40f2e6c625f716f79e1efcc4 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 28 Sep 2015 10:36:17 +0200 Subject: Fix incorrect std::string::operator[] usage Passing a position equal to length() to the non-const version of operator[] is undefined --- src/modules/m_namedmodes.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/modules/m_namedmodes.cpp') diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index 4db1f70b9..cad18cff4 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -65,6 +65,8 @@ class CommandProp : public Command while (i < parameters.size()) { std::string prop = parameters[i++]; + if (prop.empty()) + continue; bool plus = prop[0] != '-'; if (prop[0] == '+' || prop[0] == '-') prop.erase(prop.begin()); -- cgit v1.2.3