Skip to content

Commit

Permalink
bug fix: encode int string beyond int32 range, but within int64 range
Browse files Browse the repository at this point in the history
  • Loading branch information
HDT3213 committed Jun 10, 2023
1 parent d8465d2 commit e47c50a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ func (enc *Encoder) tryWriteIntString(s string) (bool, error) {
buf[0] = encodeInt32Prefix
binary.LittleEndian.PutUint32(buf[1:], uint32(int32(intVal)))
err = enc.write(buf)
} else {
// beyond int32 range, but within int64 range
return false, nil
}
if err != nil {
return true, err
Expand Down

0 comments on commit e47c50a

Please sign in to comment.