Skip to content

Commit 3f83fa5

Browse files
authored
Merge pull request #311 from zachjs/v2
Fix integer constant overflow on 32-bit systems.
2 parents f2b6f6c + 1e52f61 commit 3f83fa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bson/json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func jencNumberLong(v interface{}) ([]byte, error) {
317317
func jencInt(v interface{}) ([]byte, error) {
318318
n := v.(int)
319319
f := `{"$numberLong":"%d"}`
320-
if n <= 1<<53 {
320+
if int64(n) <= 1<<53 {
321321
f = `%d`
322322
}
323323
return fbytes(f, n), nil

0 commit comments

Comments
 (0)