From e70ef5334aa003b74bb0ed8ada49c5dd49307d4a Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 8 Jan 2020 11:33:09 +0100 Subject: [PATCH] fix array copy; ci: test prebuilt Windows package --- .github/workflows/ci.yml | 8 +++++++- vlib/builtin/array.v | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5737b05c9..3b1c8fa9b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/vlib/builtin/array.v b/vlib/builtin/array.v index e7fa70b934..c77111008a 100644 --- a/vlib/builtin/array.v +++ b/vlib/builtin/array.v @@ -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