Skip to content

Commit

Permalink
fixed issue 'makeslice: cap out of range' if negative numbes are supp…
Browse files Browse the repository at this point in the history
…lied for max and skip
  • Loading branch information
darklynx committed Jan 29, 2017
1 parent aba6c41 commit 15881bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func writeJson(w http.ResponseWriter, status int, json []byte, err error) {
func parseInt(value string, defaultValue int) int {
if len(value) > 0 {
i, err := strconv.Atoi(value)
if err == nil {
// TODO : use strconv.ParseUint(value, 10, 0) instead and switch to uint for paging
if err == nil && i >= 0 {
return i
}
}
Expand Down

0 comments on commit 15881bb

Please sign in to comment.