[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]

From: Ludovic Courtès
Date: Fri, 26 Jan 2018 09:58:00 -0500 (EST)

branch: master
commit e11bcf926d70e73eec6ad782f0a3445547f502a1
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jan 26 15:56:40 2018 +0100

    base: 'build-event-output-port' no longer reads past the buffer.
    Fixes a bug whereby 'build-event-output-port' would sometimes read more
    than COUNT from BV, which would usually result in a 'decoding-error'
    exception from 'utf8->string'.
    * src/cuirass/base.scm (build-event-output-port)[write!]: Use
    'bytevector-range' to honor COUNT and OFFSET.
 src/cuirass/base.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 50f65c1..b67b729 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -265,7 +265,7 @@ and so on. "
   (define (write! bv offset count)
-    (let loop ((str (utf8->string bv)))
+    (let loop ((str (utf8->string (bytevector-range bv offset count))))
       (match (string-index str %newline)
         ((? integer? cr)
          (let ((tail (string-take str cr)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]