Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: fix multipart copy - fixes #3778

Nick Craig-Woodf4746f5064e0
diff --git a/backend/s3/s3.go b/backend/s3/s3.go
index 991e5bf4b..a507c9078 100644
--- a/backend/s3/s3.go
+++ b/backend/s3/s3.go
@@ -1666,8 +1666,8 @@ func calculateRange(partSize, partIndex, numParts, totalSize int64) string {
start := partIndex * partSize
var ends string
if partIndex == numParts-1 {
- if totalSize >= 0 {
- ends = strconv.FormatInt(totalSize, 10)
+ if totalSize >= 1 {
+ ends = strconv.FormatInt(totalSize-1, 10)
}
} else {
ends = strconv.FormatInt(start+partSize-1, 10)