Skip to content

Commit

Permalink
use the old string replace for to fix #15
Browse files Browse the repository at this point in the history
  • Loading branch information
isieo committed Dec 19, 2014
1 parent 2843d45 commit b687e00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ vector<string> make_array(string data) {
*/
void string_replacer(string &source, const string find, const string replace) {
size_t j = 0;
for (j = source.find(find, j); j != string::npos; ) {
source.replace(j, find.length(), replace);
for ( ; (j = source.find(find,j)) != string::npos ; ) {
source.replace( j, find.length(), replace );
j = j + replace.length();
}
}
Expand Down

0 comments on commit b687e00

Please sign in to comment.