summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rw-r--r--cpp/src/Slice/PythonUtil.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index c9b4d7af4c2..f4e23f6493c 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -1999,10 +1999,11 @@ Slice::Python::CodeVisitor::editComment(const string& comment)
if(pos != string::npos)
{
string::size_type endpos = result.find('>', pos);
- if(endpos != string::npos)
+ if(endpos == string::npos)
{
- result.erase(pos, endpos - pos + 1);
+ break;
}
+ result.erase(pos, endpos - pos + 1);
}
} while(pos != string::npos);