From ca0c393161bf5ee7578f1a88a7f3ec8e44118f4b Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 5 Mar 2012 01:42:11 +0200 Subject: additional checks in math expressions --- stopspam.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stopspam.cpp') diff --git a/stopspam.cpp b/stopspam.cpp index f99e4c9..d39e84e 100755 --- a/stopspam.cpp +++ b/stopspam.cpp @@ -235,7 +235,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) std::list args; std::list actions; tstring::size_type p1 = gbQuestion.find(_T("X")), p2 = 0; - const tstring expr_chars = _T("X+-/*"); + const tstring expr_chars = _T("X+-/*"), expr_acts = _T("+-/*"); while(p1 < gbQuestion.length() && p1 != tstring::npos && expr_chars.find(gbQuestion[p1]) != tstring::npos) { std::string arg; @@ -252,7 +252,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) tmp_question.replace(p2, arg.size(), arg); #endif args.push_back(atoi(arg.c_str())); - if((p1 < gbQuestion.length()) && (p1 != tstring::npos)) + if((p1 < gbQuestion.length()) && (p1 != tstring::npos) && (expr_acts.find(gbQuestion[p1]) != tstring::npos)) actions.push_back(gbQuestion[p1]); ++p1; } -- cgit v1.2.3