added check for negative numbers

main
m455 2019-02-06 23:33:04 -05:00
parent 7e6a37d008
commit 6966408e53
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,8 @@
(equal? (vector:vector-member config:remove-command args) 0)
;; Don't allow user to remove zeroth item
(not (equal? (vector:vector-member "0" args) 1))
;; Number is positive
(positive? (string->number (vector-ref args 1)))
;; Don't allow removal of items beyond last item
(not (> (string->number (vector-ref args 1)) (length (util:file->string-list config:path)))))
(util:remove-item args)]