Permalink
Browse files

enc-unicode: fix off-by-one error in UCS coders

  • Loading branch information...
1 parent 3d7a874 commit c53ee13b19e5a3184c106aff88b38871204e88ad @luismbo luismbo committed Dec 15, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/enc-unicode.lisp
@@ -746,7 +746,7 @@ written in big-endian byte-order without a leading byte-order mark."
(type ,dest-type dest) (type ,dest-type dest)
(fixnum start end d-start)) (fixnum start end d-start))
(loop for i fixnum from start below end (loop for i fixnum from start below end
- for di fixnum from d-start by ,',bytes + and di fixnum from d-start by ,',bytes
for code of-type code-point = (,getter src i) do for code of-type code-point = (,getter src i) do
(if (>= code ,',limit) (if (>= code ,',limit)
(encoding-error code ,',name src i +repl+) (encoding-error code ,',name src i +repl+)
@@ -760,7 +760,7 @@ written in big-endian byte-order without a leading byte-order mark."
(let ((,',swap-var ,,(make-bom-check-form ''end ''start 'getter ''src))) (let ((,',swap-var ,,(make-bom-check-form ''end ''start 'getter ''src)))
(declare (ignorable ,',swap-var)) (declare (ignorable ,',swap-var))
(loop for i fixnum from start below end by ,',bytes (loop for i fixnum from start below end by ,',bytes
- for di from d-start + and di from d-start
do (,setter (let ((unit ,,(make-getter-form 'getter ''src ''i))) do (,setter (let ((unit ,,(make-getter-form 'getter ''src ''i)))
(if (>= unit ,',limit) (if (>= unit ,',limit)
(decoding-error (decoding-error

0 comments on commit c53ee13

Please sign in to comment.