From ccc6109879617f4fc910bd78d395b9eee4300a2e Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 16 Sep 2010 12:41:17 -0400 Subject: [PATCH] Fixed crash on setting XOP on --- modules/core/cs_set_xop.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/cs_set_xop.cpp b/modules/core/cs_set_xop.cpp index e08b014a1..d0c448228 100644 --- a/modules/core/cs_set_xop.cpp +++ b/modules/core/cs_set_xop.cpp @@ -39,9 +39,9 @@ class CommandCSSetXOP : public Command { ChanAccess *access; - for (unsigned i = ci->GetAccessCount() - 1; 0 <= i; --i) + for (unsigned i = ci->GetAccessCount(); i > 0; --i) { - access = ci->GetAccess(i); + access = ci->GetAccess(i - 1); /* This will probably cause wrong levels to be set, but hey, * it's better than losing it altogether. @@ -57,7 +57,7 @@ class CommandCSSetXOP : public Command else if (CHECKLEV(CA_AUTOVOICE) || CHECKLEV(CA_VOICE) || CHECKLEV(CA_VOICEME)) access->level = ACCESS_VOP; else - ci->EraseAccess(i); + ci->EraseAccess(i - 1); } reset_levels(ci);