1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fix array copy; ci: test prebuilt Windows package

This commit is contained in:
Alexander Medvednikov
2020-01-08 11:33:09 +01:00
parent e3275f6083
commit e70ef5334a
2 changed files with 8 additions and 2 deletions

View File

@ -368,7 +368,7 @@ pub fn (b []byte) hex() string {
pub fn copy(dst, src []byte) int {
if dst.len > 0 && src.len > 0 {
min := if dst.len < src.len { dst.len } else { src.len }
C.memcpy(dst.data, src[min..].data, dst.element_size * min)
C.memcpy(dst.data, src[..min].data, dst.element_size * min)
return min
}
return 0