mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] Fix a few possible cases of int truncation (#1207)
This fixes a couple of cases where due to int being platform dependent a value could get truncated if running on 32bits.
This commit is contained in:
committed by
GitHub
parent
bc917a4085
commit
847e7c7c3a
@@ -109,7 +109,7 @@ func (m *Module) SearchGETHandler(c *gin.Context) {
|
||||
limit := 2
|
||||
limitString := c.Query(LimitKey)
|
||||
if limitString != "" {
|
||||
i, err := strconv.ParseInt(limitString, 10, 64)
|
||||
i, err := strconv.ParseInt(limitString, 10, 32)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error parsing %s: %s", LimitKey, err)
|
||||
api.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGet)
|
||||
@@ -127,7 +127,7 @@ func (m *Module) SearchGETHandler(c *gin.Context) {
|
||||
offset := 0
|
||||
offsetString := c.Query(OffsetKey)
|
||||
if offsetString != "" {
|
||||
i, err := strconv.ParseInt(offsetString, 10, 64)
|
||||
i, err := strconv.ParseInt(offsetString, 10, 32)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error parsing %s: %s", OffsetKey, err)
|
||||
api.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGet)
|
||||
|
Reference in New Issue
Block a user