* added a check for non-negative integer for bytevector-uint-set!.

This commit is contained in:
Abdulaziz Ghuloum 2007-05-15 23:24:07 -04:00
parent 9488a0706f
commit 14066b3ec9
1 changed files with 3 additions and 2 deletions

View File

@ -370,7 +370,8 @@
(unless (bytevector? x) (error who "~s is not a bytevector" x)) (unless (bytevector? x) (error who "~s is not a bytevector" x))
(unless (and (fixnum? k) ($fx>= k 0)) (error who "invalid index ~s" k)) (unless (and (fixnum? k) ($fx>= k 0)) (error who "invalid index ~s" k))
(unless (and (fixnum? size) ($fx>= size 1)) (error who "invalid size ~s" size)) (unless (and (fixnum? size) ($fx>= size 1)) (error who "invalid size ~s" size))
(unless (or (fixnum? n) (bignum? n)) (error who "invalid value ~s" n)) (unless (or (and (fixnum? n) ($fx>= n 0)) (and (bignum? n) (>= n 0)))
(error who "invalid value ~s" n))
(case endianness (case endianness
[(little) (little-uint-set! x k n size)] [(little) (little-uint-set! x k n size)]
[(big) (big-uint-set! x k n ($fx+ k size))] [(big) (big-uint-set! x k n ($fx+ k size))]