* added a check for non-negative integer for bytevector-uint-set!.
This commit is contained in:
parent
9488a0706f
commit
14066b3ec9
|
@ -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))]
|
||||||
|
|
Loading…
Reference in New Issue