Skip to content

Commit 1e52f61

Browse files
committed
fix integer constant overflow on 32-bit systems
1 parent 0108465 commit 1e52f61

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)