]> Cypherpunks repositories - gostls13.git/commitdiff
bug in copy
authorKen Thompson <ken@golang.org>
Wed, 18 Nov 2009 04:44:35 +0000 (20:44 -0800)
committerKen Thompson <ken@golang.org>
Wed, 18 Nov 2009 04:44:35 +0000 (20:44 -0800)
R=rsc
https://golang.org/cl/156056

src/pkg/runtime/slice.c

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