diff --git a/utils.h b/utils.h index a12566a..996dcb4 100644 --- a/utils.h +++ b/utils.h @@ -87,8 +87,8 @@ vector 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(); } }