mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix srs_string_replace deap loop when new_str inclue old_str (#2580)
This commit is contained in:
parent
6bb11a72d0
commit
714e182096
2 changed files with 10 additions and 0 deletions
|
@ -308,6 +308,7 @@ string srs_string_replace(string str, string old_str, string new_str)
|
|||
size_t pos = 0;
|
||||
while ((pos = ret.find(old_str, pos)) != std::string::npos) {
|
||||
ret = ret.replace(pos, old_str.length(), new_str);
|
||||
pos += new_str.length();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue