Skip to content

Commit

Permalink
string.wrap: use s.len instead of 50
Browse files Browse the repository at this point in the history
Co-authored-by: Delyan Angelov <[email protected]>
  • Loading branch information
StunxFS and spytheman authored Oct 7, 2024
1 parent 54b3d91 commit 426732a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/builtin/string.v
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ pub fn (s string) wrap(config WrapConfig) string {
if words.len == 0 {
return ''
}
mut sb := strings.new_builder(50)
mut sb := strings.new_builder(s.len)
sb.write_string(words[0])
mut space_left := config.width - words[0].len
for i in 1 .. words.len {
Expand Down

0 comments on commit 426732a

Please sign in to comment.