Skip to content

Commit 0eb23ec

Browse files
committed
Str::Replace
1 parent fb30b74 commit 0eb23ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AudioBasic/Str.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class Str {
436436
insert_len = len_replaced-len_to_replace;
437437
grow(this->length()+insert_len);
438438
// save remainder and create gap
439-
memmove(this->chars+pos+len_replaced, this->chars+pos+len_to_replace, old_len-pos+len_to_replace+1);
439+
memmove(this->chars+pos+len_replaced, this->chars+pos+len_to_replace, old_len-pos-len_to_replace+1);
440440
// move new string into gap
441441
memmove(this->chars+pos,replaced,len_replaced);
442442
result = true;

0 commit comments

Comments
 (0)