mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Fix incorrect result for replace_all (bug 5064, r=dvander).
This commit is contained in:
parent
ea2a4889fe
commit
e3824c4c87
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user