Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better guard against wrong input

  • Loading branch information...
commit 2112ff509b33656bff9eb569b4df90d1641d2cc7 1 parent 07b021e
@ckeen authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 pastiche.scm
View
6 pastiche.scm
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.