Skip to content

Commit

Permalink
fix: issue #86, swap from strconv.Atoi to strconv.ParseInt(parts[1], …
Browse files Browse the repository at this point in the history
…10, 64) (#87)

This change solves a problem on 32-bit systems where file sizes larger than 2^32 could not be parsed. By using ParseInt directly and setting the bit-size to 64 explicitly, the size is always parsed and stored as a 64-bit integer regardless of the host platform.
  • Loading branch information
Codycody31 authored Jun 21, 2024
1 parent 71c7406 commit 5ac8595
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func ParseFileInfos(message string, fileInfos *FileInfos) error {
return err
}

size, err := strconv.Atoi(parts[1])
size, err := strconv.ParseInt(parts[1], 10, 64)
if err != nil {
return err
}
Expand Down

0 comments on commit 5ac8595

Please sign in to comment.