X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;ds=sidebyside;f=example%2Fdiameter%2Flauncher%2FEventOperation.cpp;h=f21f729b8b6870cf5fdafea024b60bba9881b179;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=4d80410f542953b23c02be25899777b16cf91a03;hpb=e782294456d0877aa8fc05aa931291ac79808eb3;p=anna.git
diff --git a/example/diameter/launcher/EventOperation.cpp b/example/diameter/launcher/EventOperation.cpp
index 4d80410..f21f729 100644
--- a/example/diameter/launcher/EventOperation.cpp
+++ b/example/diameter/launcher/EventOperation.cpp
@@ -754,18 +754,22 @@ bool EventOperation::test_id__waitfefc_msg(std::string &response, unsigned int i
std::string::size_type pos, pos_1, pos_2;
pos = regexp.find("end-to-end-id=", 0u);
- pos = regexp.find("\"", pos);
- pos_1 = pos;
- pos = regexp.find("\"", pos+1);
- pos_2 = pos;
- regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ if (pos != std::string::npos) {
+ pos = regexp.find("\"", pos);
+ pos_1 = pos;
+ pos = regexp.find("\"", pos+1);
+ pos_2 = pos;
+ regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ }
pos = regexp.find("hop-by-hop-id=", 0u);
- pos = regexp.find("\"", pos);
- pos_1 = pos;
- pos = regexp.find("\"", pos+1);
- pos_2 = pos;
- regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ if (pos != std::string::npos) {
+ pos = regexp.find("\"", pos);
+ pos_1 = pos;
+ pos = regexp.find("\"", pos+1);
+ pos_2 = pos;
+ regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ }
// For this representation:
//pos = regexp.find("Origin-State-Id", 0u);
@@ -777,13 +781,15 @@ bool EventOperation::test_id__waitfefc_msg(std::string &response, unsigned int i
//regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
// But we have this one:
pos = regexp.find("Origin-State-Id", 0u);
- pos = regexp.rfind("\"", pos);
- pos = regexp.rfind("\"", pos-1);
- pos = regexp.rfind("\"", pos-1);
- pos_1 = pos;
- pos = regexp.find("\"", pos+1);
- pos_2 = pos;
- regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ if (pos != std::string::npos) {
+ pos = regexp.rfind("\"", pos);
+ pos = regexp.rfind("\"", pos-1);
+ pos = regexp.rfind("\"", pos-1);
+ pos_1 = pos;
+ pos = regexp.find("\"", pos+1);
+ pos_2 = pos;
+ regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+");
+ }
//regexp.insert(0, "^");
//regexp += "$";