From 2c3e44eb20cde7083f405d66b68ca65c20c5908f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 28 Oct 2021 17:00:10 +0300 Subject: [PATCH] strings: use memdup_noscan in Builder.str() --- vlib/strings/builder.c.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/strings/builder.c.v b/vlib/strings/builder.c.v index 4616a19f2a..c8aa6ab490 100644 --- a/vlib/strings/builder.c.v +++ b/vlib/strings/builder.c.v @@ -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