strings: use memdup_noscan in Builder.str()

pull/12298/head
Delyan Angelov 2021-10-28 17:00:10 +03:00
parent a987440e2f
commit 2c3e44eb20
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ pub fn (b &Builder) after(n int) string {
// .str() call.
pub fn (mut b Builder) str() string {
b << byte(0)
bcopy := unsafe { &byte(memdup(b.data, b.len)) }
bcopy := unsafe { &byte(memdup_noscan(b.data, b.len)) }
s := unsafe { bcopy.vstring_with_len(b.len - 1) }
b.trim(0)
return s