Fix wrong required size

This commit is contained in:
Lukas Herman
2020-05-15 00:35:57 -04:00
parent 65b744f639
commit c6e685964f
2 changed files with 46 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ package io
// InsufficientBufferError.
func Copy(dst, src []byte) (n int, err error) {
if len(dst) < len(src) {
return 0, &InsufficientBufferError{len(dst)}
return 0, &InsufficientBufferError{len(src)}
}
return copy(dst, src), nil