Skip to content

Commit

Permalink
Better guard against wrong input
Browse files Browse the repository at this point in the history
  • Loading branch information
ckeen committed May 22, 2011
1 parent 07b021e commit 2112ff5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pastiche.scm
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@
(with-request-variables
((from as-number)
(to as-number))
(let* ((from (or from 0))
(to (or to browsing-steps))
(nposts (number-of-posts))
(let* ((nposts (number-of-posts))
(from (if (and from (>= from 0) (<= from nposts)) from 0))
(to (if (and to (> to from) (<= to nposts)) to browsing-steps))
(older-to (min (+ to browsing-steps) nposts))
(older-from (+ from browsing-steps))
(newer-from (- from browsing-steps))
Expand Down

0 comments on commit 2112ff5

Please sign in to comment.