From: Chris Hanson Date: Mon, 30 Apr 2018 17:55:24 +0000 (-0700) Subject: Fix thinko as reported by Patric Jonsson. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~91 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3e7583b05de6e67fd103eb739a16d5f4971a91a0;p=mit-scheme.git Fix thinko as reported by Patric Jonsson. Incorrectly computed length of result in exact-nonnegative-integer->bytevector. --- diff --git a/src/runtime/bytevector.scm b/src/runtime/bytevector.scm index da6aefeab..6aa8efbb9 100644 --- a/src/runtime/bytevector.scm +++ b/src/runtime/bytevector.scm @@ -467,7 +467,7 @@ USA. (define (exact-nonnegative-integer->bytevector n) (guarantee exact-nonnegative-integer? n 'exact-nonnegative-integer->bytevector) - (let* ((n-bytes (quotient (+ (integer-length-in-bits n) #xFF) #x100)) + (let* ((n-bytes (quotient (+ (integer-length-in-bits n) 7) 8)) (result (make-bytevector n-bytes))) (do ((n n (quotient n #x100)) (i 0 (fix:+ i 1)))