fix array copy; ci: test prebuilt Windows package

pull/3372/head
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

@ -162,8 +162,14 @@ jobs:
windows-prebuilt:
runs-on: windows-2019
steps:
shell: bash
- name: Download V
run: echo "test" #wget https://github.com/vbinaries/vbinaries/releases/download/latest/v_windows.zip && unzip v_windows.zip && ./v.exe --version
run: |
echo "Downloading v.exe..."
wget https://github.com/vbinaries/vbinaries/releases/download/latest/v_windows.zip
unzip v_windows.zip
./v.exe --version
echo "Done"
- name: Test V
run: echo "test" #./v.exe examples/hello_world.v && examples/hello_world.exe

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