Skip to content

Commit d362e65

Browse files
authored
builtin: make result string end with null in u8(x).repeat(y) (fix regression after #22100) (#25625)
1 parent 5d4b307 commit d362e65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vlib/builtin/int.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ pub fn (b u8) repeat(count int) string {
588588
mut bytes := unsafe { malloc_noscan(count + 1) }
589589
unsafe {
590590
vmemset(bytes, b, count)
591-
bytes[count] = `0`
591+
bytes[count] = 0
592592
}
593593
return unsafe { bytes.vstring_with_len(count) }
594594
}

0 commit comments

Comments
 (0)