Skip to content

Commit

Permalink
Cast sz to uint32 to fix compilation on 32 bit (#1175)
Browse files Browse the repository at this point in the history
`env GOOS=linux GOARCH=arm GOARM=7 go build` no longer fails with overflow.

Similar to commit fb0cdb8.

Signed-off-by: Christian Stewart <[email protected]>
  • Loading branch information
paralin authored and Ibrahim Jarif committed Dec 28, 2019
1 parent ea01d38 commit 465f28a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion value.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,11 @@ func (lf *logFile) open(path string, flags uint32) error {
return errFile(err, lf.path, "Unable to run file.Stat")
}
sz := fi.Size()
y.AssertTruef(sz <= math.MaxUint32, "file size: %d greater than %d", sz, math.MaxUint32)
y.AssertTruef(
sz <= math.MaxUint32,
"file size: %d greater than %d",
uint32(sz), uint32(math.MaxUint32),
)
lf.size = uint32(sz)
if sz < vlogHeaderSize {
// Every vlog file should have at least vlogHeaderSize. If it is less than vlogHeaderSize
Expand Down

0 comments on commit 465f28a

Please sign in to comment.