1
0
mirror of https://github.com/golang/go synced 2024-11-20 03:44:40 -07:00

bug in copy

R=rsc
https://golang.org/cl/156056
This commit is contained in:
Ken Thompson 2009-11-17 20:44:35 -08:00
parent c4606d05da
commit 948f3e77e1

View File

@ -189,7 +189,7 @@ runtime·slicecopy(Slice to, Slice fm, uintptr width, int32 ret)
} }
ret = fm.len; ret = fm.len;
if(to.len > ret) if(to.len < ret)
ret = to.len; ret = to.len;
memmove(to.array, fm.array, ret*width); memmove(to.array, fm.array, ret*width);