bugfix: correct string length computation in replace_all

This commit is contained in:
Pavol Marko 2006-09-12 13:26:40 +00:00
parent 651c5d9f01
commit d925dc6e41

View File

@ -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;