diff --git a/plugins/include/string.inc b/plugins/include/string.inc index 48063c2c..7a5674a5 100755 --- a/plugins/include/string.inc +++ b/plugins/include/string.inc @@ -238,6 +238,8 @@ stock replace_all(string[], len, const what[], const with[]) while (replace(string[pos], len - pos, what, with) != 0) { + total++; + /* jump to position after replacement */ pos += with_len; @@ -261,7 +263,6 @@ stock replace_all(string[], len, const what[], const with[]) /* otherwise, reposition and update counters */ pos += temp_pos; - total++; } return total;