bugfix: correct string length computation in replace_all
This commit is contained in:
parent
651c5d9f01
commit
d925dc6e41
|
@ -234,7 +234,7 @@ stock replace_all(string[], len, what[], with[])
|
||||||
new total_len = strlen(string);
|
new total_len = strlen(string);
|
||||||
new temp_pos = 0
|
new temp_pos = 0
|
||||||
|
|
||||||
while (replace(string[pos], len, what, with) != 0)
|
while (replace(string[pos], len - pos, what, with) != 0)
|
||||||
{
|
{
|
||||||
/* jump to position after replacement */
|
/* jump to position after replacement */
|
||||||
pos += with_len;
|
pos += with_len;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user