diff --git a/examples/osg2cpp/osg2cpp.cpp b/examples/osg2cpp/osg2cpp.cpp index 33357af2c..a76f7c975 100644 --- a/examples/osg2cpp/osg2cpp.cpp +++ b/examples/osg2cpp/osg2cpp.cpp @@ -14,6 +14,7 @@ void searchAndReplace(std::string& str, const std::string& spat, const std::stri while ((pos = str.find(spat, pos)) != std::string::npos) { str.replace(pos, spat.length(), rpat); + pos += rpat.length(); } }