Permalink
Browse files

Fix 32 bit wrapping issue in bulkRead.

This should fix downloading large (> 2G) files on 32-bit platforms.
  • Loading branch information...
hanwen committed Feb 24, 2013
1 parent 426abc1 commit e9b64b117aeaf926fee1cd2f79ed835e74649034
Showing with 2 additions and 2 deletions.
  1. +2 −2 mtp/mtp.go
View
@@ -345,9 +345,9 @@ func (d *Device) runTransaction(req *Container, rep *Container,
log.Printf("MTP data 0x%x bytes", h.Length)
}
- size := int(h.Length)
+ size := int64(h.Length)
dest.Write(rest)
- size -= len(rest) + usbHdrLen
+ size -= int64(len(rest) + usbHdrLen)
if size > 0 {
_, err = d.bulkRead(dest)
if err != nil {

0 comments on commit e9b64b1

Please sign in to comment.